'Good code' is code that works, is bug free, and is readable and
maintainable. Standards need to be followed for coding. Read more...
http://brsx.co.uk/SWtesting/FAQs/FAQs012.asp
He goes on to write
"...but everyone has different ideas about what's best, or what is too many
or too few rules."
and therein lies the problem.
For example, my code tends to be completely devoid of comments (because I
find them distracting interspersed with the code -- the code itself should
be expressive enough without all that chatter) -- except for JavaDocs, which
I write copiously. It gives me a nice place to describe the class, member
variable, or method, with the input parameters, return values and exceptions
thrown, in a way that is far more structured than you would get with ad-hoc
comments. In fact, if I find myself writing a comment inline with the code
(often justifying something that is just "too cool"), it is usually an
indication that my implementation is flawed.
I tend to keep my methods rather short (less than a screenful). It makes it
easier to document and understand what is going on, and helps to modularize
the operations. That is just my style developed over 25 years of programming
professionally. I developed a "JavaDoc" style of commenting my code when I
was developing in C. I don't expect everyone to follow my style.
As for whitespace and bracket alignment, I often thought that repositories
should delete all extra whitespace, and editors should expand it back
according to individual developer preferences. That hasn't happened yet.