The 100% Correct Coding Style Guide
Bill Sourour
3.5K56

The most important standard isn’t style; it’s consistency. Whatever style standard you choose for a codebase, it’s important that new additions are consistent with that style. What drives me up the wall isn’t a coding style that is different from my own, but rather a codebase which adhered to absolutely no specific style throughout, even within the same file.

Look, if you’re going to use tabs, be consistent, and use tabs everywhere. If you’re going to use spaces, use them everywhere. The same goes for spacing around parentheses, brace positioning, variable naming, etc. The files which have a mixture of multiple styles are the ones that drive even non-pedantic programmers up the wall.

And the reason for this is simple: mixed styles make the code extremely difficult to read and sometimes difficult to debug. How many times have you sat there trying to figure out a weird bug, only to find out it was caused by a miscapitalized variable name or an assumption based upon badly indented code?

Like what you read? Give Tilghman Lesher a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.