Let's end the formatting mess

Wolfgang Bangerth bangerth at math.tamu.edu
Wed Nov 9 15:44:25 UTC 2011


From someone who's been involved in large software for a long time, let me say 
this about formatting:

People have differing opinions on how code should be formatted as it is 
largely an esthetic question. But, like documentation of code, one needs to 
ask what the purpose of formatting is, and the answer is that largely it's to 
make code easier to read, and this primarily does not apply to the person who 
actually wrote it but to those who did not but need to understand what is 
happening -- either because they are working on other parts of the code that 
is somehow connected, or because they take over a piece of code once the 
original author no longer works on this project.

From this perspective, it doesn't matter whether code is formatted with 2 or 4 
spaces but it is awkward at best if different pieces of the code base are 
formatted in different ways or if authors use different naming conventions. 
Some newcomers to a project will consider this too messy to continue working 
on it; some will find their productivity limited because it is more difficult 
to understand code than necessary; etc. No open source project can afford to 
lose potential contributors. Successful open source projects do not just 
produce good software, but they are also typically very careful to make the 
hurdle for entry to newcomers as low as possible and as a consequence many 
have adopted a common coding standard to make it easier to read existing code.

As I said, *what* coding standard a project adopts is an entirely unimportant 
question. It is *that* a project has a coding standard that matters.

Best
 W.

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            bangerth at math.tamu.edu
                                 www: http://www.math.tamu.edu/~bangerth/




More information about the KDevelop-devel mailing list