DIMAJIX - software consulting (http://www.dimajix.de/)
 

Source Code Formatting


Recommendation 2. Establish a mandatory style guide for visual source code formatting.

A common problem in a development team are different personal preferences about source code formatting. This may lead to a loss of readability of the code as different sections written by different team members may disagree significantly in style. So it might be a good idea to introduce a mandatory style guide that ensures a homogenous style of the source code. This guide may include rules for the following topics
  • Indentation. By how many spaces should blocks be indented? Should tabs or white-spaces be used?
  • Placements of brackets. This refers to control structures like if, while etc.
This guide does intentionally contain no specific guide for source code formatting as there are many opinions about the correct way, and at the end it is all about habits people are used to. In many cases there are no real arguments for or against specific rules.



Kaya Memisoglu 2005-01-06