Summary
This sentence is repeated like a mantra in more than one book discussing clean code practices. No wonder, as this is very true, as tested in practice by many software developers – so much so that rules for even minuscule things such as the numbers of spaces, newlines, and the ordering of #import
statements have been codified. This isn't done out of pettiness, but to save time. By following the practices outlined in this chapter, we don't need to worry about formatting code correctly by hand. It will automatically get formatted as a side effect of building – a step that we have to do anyway to check whether the code is working correctly. By introducing ClangFormat, we can also ensure that it looks proper.
Of course, we want more than a simple whitespace correction; code has to conform to dozens of other...