david wrote:
I have also wished that the available scripts were fully commented - it would make the learning process much easier.
However, I think it would be unfair to expect the script writers to do that!
david.
The appropriate level of comment in code is always debatable. My rule is to write comments that I'll find useful 6 months in the future, on a bad day, so this covers mostly the more tricky parts(*) and the unexpected things (aka the
WTF factor). General code hygiene (clean structure, well-chosen names) removes the need for most comments.
Writing comments for a beginner would be mostly stating the obvious... and make the code hard to read by non-beginners.
(*) with limits:
Djiskra: "The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague."
Kernighan: “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”