<snip>
 Back in the days of fanfold, there was a type of programmer who
would only put five or ten lines of code on a page, preceded by twenty
lines of elaborately formatted comments
<snip>

After many years of consulting and support work, I have found that I
generally prefer to work on these fellows code.

Of course, you may enjoy working crossword puzzles and uncommented code as
some sort of a character building exercise;  It takes all kinds of people to
make the world go 'round! With any luck at all, the original author may have
selected meaningless variable name and labels to enhance the challenge.

If you are fixing code that someone else wrote, you may never learn the
original premises that the code was based on, and you may never figure out
how some parts work. I suppose that everybody needs a little mystery in
their lives. One of my all-time favorites is uncommented tables of magic
numbers, with calculated indexes into them. ARGH!

I have further found that code that *I* dashed off in the quick and dirty
mode was vary hard to support. In a few cases, it was easier to write it
again rather than figure out what I had written before. It is strange that
when you were "in the zone" it all made sense and fit together. The fact is
that it took a long time working through the problem to get zoned in the
first place. Sadly, without good comments, it make take about the same
amount of time to get zoned in again.

I have also found that when I spent the time writing these comment blocks
myself, I was forced to actually work out what I was going to do before I
started spewing code -- my code was usually better for it.

One of my most amazing observations (to me anyway) is that the extra time
spent working through a problem frequently reduced  the number of lines of
code. Inside of hairy-nasty poorly defined problem, there is usually a tiny
little problem with an elegant solution trying to get out. It may be
possible that with no useful comments the amount of extra code generated
would have taken the same space as the comments.

I will go out on a limb and state that the time saved not writing useful
comments *will* be replaced by debugging time.

Naturally, YMMV

Mark Browne




_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
Help beta test TCLUG's potential new home: http://plone.mn-linux.org
Got pictures for TCLUG? Beta test http://plone.mn-linux.org/gallery
tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list