Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Cobol > Re: Did I write...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 27 of 57 Topic 4074 of 4196
Post > Topic >>

Re: Did I write a good (efficient) program?

by "Pete Dashwood" <dashwood@[EMAIL PROTECTED] > Apr 2, 2008 at 10:07 AM

-- 
"I used to write COBOL...now I can do anything."
"Michael Mattias" <mmattias@[EMAIL PROTECTED]
> wrote in message 
news:57qIj.23163$0o7.2366@[EMAIL PROTECTED]
> You know, I've always used three tests to decide if code is
well-written:
>
> 1. Does it work?
> 2. Is it *relatively* efficient?
> 3. Is it maintainable?
>

Yep, same priorities I have always observed also...

However, in the light of my experience over the last decade or so, I would

qualify these criteria with: "applies only to Procedural Code."

OO Code has a different set...

1.  Does it work?
2.  Is it small and complete (encapsulated)?
3.  Can I reuse and extend it easily?

Efficiency is taken care of by keeping components small, and using 
optimizing compilers.

Maintainability is not a consideration as long as the interface is simple
or 
non existent. I like to use internal properties (via GETTERs and SETTERs)
to 
modify behaviour of components, as this avoids needing parameter
interfaces, 
but it isn't a hard and fast or black and white rule, and it is certainly 
arguable... I have found it works and can completely eliminate
maintenance. 
These days I write stuff, thoroughly debug it, then forget about it. I
don't 
plan to "maintain" encapsulated functionality, and, so far, I have never
had 
to. I also don't need to regression test new functionality because it
cannot 
affect existing functionality, which continues to function as it always
has. 
OO encapsulation is a form of "ringfencing" for systems.

To modify existing functionality does NOT mean modifying a base class. It 
means extending (through inheritance) or over-riding existing behaviours. 
Again, only the parts of the system that invoke the modified functionality

need to be tested as the rest of the system is isolated from the changes.

This is, obviously, a different world from COBOL, which was conceived as 
being "easily maintainable" in the days when that was im****tant.

> You need a "yes" answer to all three questions to have well-written
code.

Yes, but the question set is different between Procedural and Object 
Oriented code.
>
> While 'works' is non-negotiable, I'll often often trade 'ultimate 
> efficiency'  for maintainability; e.g., "ultimate" efficiency can often
be 
> best achieved by using lots of GO TOs; but this comes at a
maintainability 
> cost I am generally not willing to pay.
>
> All done, but need more efficiency?  My rule for optimizing may help: 
> First you make it work; only then can you make it work better.

Emphaticaly agreed :-) For both Procedural and OO...

Pete.
-- 
"I used to write COBOL...now I can do anything."
 




 57 Posts in Topic:
Did I write a good (efficient) program?
MikeB <MPBrede@[EMAIL   2008-03-30 06:37:28 
Re: Did I write a good (efficient) program?
spambait@[EMAIL PROTECTED  2008-03-30 15:09:03 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-03-30 11:47:14 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-03-30 21:09:28 
Re: Did I write a good (efficient) program?
MikeB <MPBrede@[EMAIL   2008-03-30 11:52:44 
Re: Did I write a good (efficient) program?
"HeyBub" <he  2008-03-30 19:47:27 
Re: Did I write a good (efficient) program?
MikeB <MPBrede@[EMAIL   2008-03-30 12:22:30 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-03-30 18:44:48 
Re: Did I write a good (efficient) program?
Richard <riplin@[EMAIL  2008-03-31 12:10:23 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-03-31 20:40:31 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-03-31 18:20:29 
Re: Did I write a good (efficient) program?
"Michael Mattias&quo  2008-04-01 12:44:49 
Re: Did I write a good (efficient) program?
docdwarf@[EMAIL PROTECTED  2008-04-01 14:29:40 
Re: Did I write a good (efficient) program?
Howard Brazee <howard@  2008-04-01 08:43:48 
Re: Did I write a good (efficient) program?
"Michael Mattias&quo  2008-04-01 16:04:49 
Re: Did I write a good (efficient) program?
Howard Brazee <howard@  2008-04-01 11:08:06 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-02 10:44:20 
Re: Did I write a good (efficient) program?
"Michael Mattias&quo  2008-04-01 23:21:29 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-02 13:37:38 
Re: Did I write a good (efficient) program?
Clark F Morris <cfmpub  2008-04-01 21:43:15 
Re: Did I write a good (efficient) program?
SkippyPB <swiegand@[EM  2008-04-02 11:50:47 
Re: Did I write a good (efficient) program?
"Michael Mattias&quo  2008-04-02 11:01:28 
Re: Did I write a good (efficient) program?
SkippyPB <swiegand@[EM  2008-04-03 11:46:22 
Re: Did I write a good (efficient) program?
Howard Brazee <howard@  2008-04-03 10:01:01 
Re: Did I write a good (efficient) program?
SkippyPB <swiegand@[EM  2008-04-04 11:08:39 
Re: Did I write a good (efficient) program?
"HeyBub" <he  2008-04-03 18:07:19 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-02 10:07:54 
Re: Did I write a good (efficient) program?
Howard Brazee <howard@  2008-04-02 07:53:35 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-03 10:40:31 
Re: Did I write a good (efficient) program?
Howard Brazee <howard@  2008-04-03 07:47:45 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-04-02 23:08:22 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-04 01:39:13 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-04-03 19:31:14 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-04 17:14:34 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-04-04 05:05:35 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-04 23:37:21 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-04-04 13:58:33 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-05 11:27:41 
Re: Did I write a good (efficient) program?
Howard Brazee <howard@  2008-04-04 07:53:10 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-04-04 11:20:56 
Re: Did I write a good (efficient) program?
Howard Brazee <howard@  2008-04-04 11:46:09 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-05 11:53:54 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-05 11:41:47 
Re: Did I write a good (efficient) program?
Richard <riplin@[EMAIL  2008-03-31 23:00:30 
Re: Did I write a good (efficient) program?
"tlmfru" <la  2008-04-01 12:15:13 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-02 09:41:51 
Re: Did I write a good (efficient) program?
"Pete Dashwood"  2008-04-02 09:30:55 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-04-01 13:01:45 
Re: Did I write a good (efficient) program?
MikeB <MPBrede@[EMAIL   2008-04-01 23:20:50 
Re: Did I write a good (efficient) program?
"Rick Smith" &l  2008-04-02 03:08:22 
Re: Did I write a good (efficient) program?
jnjsle1@[EMAIL PROTECTED]  2008-05-16 07:21:01 
Re: Did I write a good (efficient) program?
jnjsle1@[EMAIL PROTECTED]  2008-05-16 07:31:20 
Re: Did I write a good (efficient) program?
"HeyBub" <he  2008-05-16 10:34:50 
Re: Did I write a good (efficient) program?
jnjsle1@[EMAIL PROTECTED]  2008-05-16 11:21:29 
Re: Did I write a good (efficient) program?
jnjsle1@[EMAIL PROTECTED]  2008-05-16 11:27:44 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-05-16 21:13:06 
Re: Did I write a good (efficient) program?
jnjsle1@[EMAIL PROTECTED]  2008-05-16 11:32:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 3:22:16 CDT 2008.