White Space – the Developer’s Friend

I've been around software development and developers for longer than I care to admit - and I have repeatedly encountered a bad habit that is common to many of them. It may seem a small thing, but inconsistent use of spaces and tabs in code really gets my goat!

When misters Kerninghan and Ritchie wrote their epic work on the C language, they include a whole bunch of good advise on indenting style. Other languages have come along since then that use bracketing schemes to which the same advise applies. The point is: a good and consistent discipline in this area makes code easier to read for both the original developer and others who work on it later. "Easy to read" means "easy to update" as well - so good indenting actually reduces costs in the long term.

I have often had to work on code written by others where style standards have been broken, and seen first hand the extra time and effort required to make changes when this is the case. Even perfectly well formatted code gets broken by subsequent editors.

This isn't an issue that is restricted to the "C" family of languages, but applies across the board to almost every programming and markup language in common use today. HTML developers are often some of the worst in this area!

I have become a bit of a "bore" on this topic with development teams that know me well. For me: code layout and indenting discipline is an important part of code quality, and should be reviewed as part of the sign-off process. If its down to me, edits that break indenting style would be rejected at the QA stage - even if the code "works". I'm sorry but just adding a few lines of code without addressing the layout changes they imply is simply unacceptable. This is one of the facts that differentiates "hobby" programming from industrial strength code.


Scroll to Top