[thelist] RE: Quality Code: Definitions

Ornstein, Ian IanOrnstein at NC.SLR.com
Wed Sep 5 08:17:47 CDT 2001

For me the issue is maintainability.
I recall reading that for every hour spent on initial development,
four additional hours are spent on maintenance and improvements.

Those whose task is to make the changes have much less time than the
original developer to learn the task and the code.  They must be able
to locate the place to make the change and do it surgically.

so now for give me a rant an rave:

I dislike JavaScript code ( or CSS) where the braces are {
 not aligned vertically.

I dislike JavaScript code where all the vars are
not defined at the beginning of the function.

I dislike JavaScript code where the author is being cute ( or lazy)
and writes 

var fred = foobar;
     To me ( because of my background in 3gls) all vars
should be declared BEFORE they are used.  How much can that cost?

I dislike JavaScript code where the code reads "if george".
What the heck is george.
I like code that reads "if george = 0"  or " if george = "null"

I absolutely hate JavaScript code where the user assigns and defines
a function as part of an object definition. Let him define the function
previously, give it a name and refer to it by name.

All these rules, if followed, would help the maintainer and improve the 
quality of the code.

- IanO -

More information about the thelist mailing list