Coding for Better Understanding

A recent article in the Communications of the ACM focuses on how to improve the understandability of code. "Coding Guidelines: Finding the Art in the Science" by Robert Green and Henry Ledgard addresses a number of often overlooked aspects of code design, including:

  • Statement alignment.
  • Component naming.
  • The use of white space.
  • Syntax highlighting.

Many developers feel that work done to improve the appearance and understandabililty of code is wasted effort. They will often work to make code as compact and sometimes as obscure as possible.

This might work well for them while the function of the code is recently developed in their own head. But someone, even themselves, trying to maintain or improve the code sometime in the future would likely find it very difficult to understand.

Using principles such as those above can, over the long run, decrease development costs and improve code performance.