Coding Style

One of the most important skills for any team of engineers is to develop a consistent coding style. Without it, development and debugging times increase and productivity decreases. Coding style is much like the rules of writing a story. Sentences start with a capital letter and end in a period. New ideas are started in new paragraphs. Spaces exist between letters of words. If someone were to write a book without following those conventions, it would be substantially more difficult to read. Coding style works the same way.

One of the projects I worked for years was a complicated telephony system. It included low-level code for interfacing with the phone boards as well as high-level code for displaying data to the user. This was a lengthy project that took substantial time to develop. During development, John and I worked to develop a consistent coding style. A mentor on the team, Mark, would review our code, provide feedback, and fanatically insist on standard coding conventions and style.

At first, this seemed silly to me. I’m a developer, let me do what I do! But, as time went on, it became increasingly apparent how valuable it was. After a while, I was unable to tell the code I wrote from what John wrote. While this may seem silly, this meant that when bugs were found, either of us could feel equally comfortable understanding and changing the code.

Today, when I learn a new language, one of the first things I try to do is learn standard coding conventions for that language. Some languages, like Java, have well established and followed conventions. Unfortunately, many other languages do not. When that happens, the team needs to determine what conventions they will follow for their team. If not, expect bugs to take longer and development to be slower.

Leave a Reply