Should the FZ3-Sourcecode be commented or not?

Moderator: Project members

Should the code be commented?

Yes, especially if it is a larger project.
29
88%
No, if the code's structure is clean.
2
6%
Undecided, Don't know.
2
6%
 
Total votes: 33

Message
Author
bobharvey
504 Command not implemented
Posts: 9
Joined: 2004-12-31 14:20

#16 Post by bobharvey » 2005-01-19 10:53

I worked for Rockwell for about 10 years, and we had a house style that required at leat 10 lines of comment per line of code. It did lead to absurdities like

Code: Select all

push  ax  ; put contents of ax on the stack
which have to be avoided.

But neither C nor Pascal are self-documenting as to the designer's purpose or intention. Sometimes a good way of debugging is to work out what the original person was trying to achieve, and then you can follow the code to see why it doesn't.

Similarly exceptions and branches always need some explanation of how they might occur.

All that said, I once found the following in a bit of unix code:

Code: Select all

# You aren't supposed to understand the next bit 

Post Reply