if x==456 then //checks for conditional x and executes code if x is true

In What Workplace Coding Practices Do You Use? (Slashdot), there are some interesting notes about coding practices. The main one is, of course, the use of comments (and good ones: synchronised with code update, not too short, not too long, not explaining obvious lines like (if x == 456) except if it has a very special meaning, it may be interesting to write comments first in order to have clear ideas of what we want from the code, etc.).

A good comment is not describing what is done (since everybody can see that from the code itself), a good comment describes why something is done, or what the overall objective of the statement is.

The best advice I ever got was to write “why”, not “what” a piece of code does. Any Computer Science peon knows that “counter++” increments counter. What they might not know is why.

Other recommendations include good variable and function names, try not to make any absurdly complicated statements, code review by another person, use of unit testing, etc. Finally, I will add two nice links: one /. comment listing 15 things to do (and not to do) and joelonsoftware.

Computer science is there at least since the years 1960 and, since then, people were not able to agree on final standards. Maybe it’s because computer science is not the one it used to be 40 years ago: we have more programming languages, more operating systems, more development environments, etc.