It is rare that quality of code is covered in the press or mentioned in the press release of a programming project. More often than not, it’s used as a pretext for delays. But the quality of code has little to do with the style of the sources or the number of bugs the program may contain. It’s how easily the idea behind the code can be accessed by the reader. Although obvious, this point is not well enough appreciated and teached to beginners. More often it’s expressed like a warning, that great care has to be taken up front to avoid problems later, but no specific details are given. So here is my little check-list for good code:

  • First of all, understand the algorithm which should be implemented.
  • The coding standard used, should fit the language, the project and the external factors.
  • Good code is not necessarily short code, although the building blocks ought not exceed certain limits.
  • Explanations should address the motivation behind the code, because it’s already in the sources what it does.

By checking existing code against this list, one has a good reference point to estimate the quality of the code. And reading good code will make you a better programmer. But this is another post…