Part 2 In practice

 

Chapter 1 established the grandly named “six pillars of code quality.” These provide some high-level strategies that can help ensure our code is of high quality. In part 2, we delve deeper into the first five of these in a more practical way.

Each chapter in part 2 concentrates on one of the pillars of code quality, with each section within the chapters demonstrating a particular consideration or technique. The general pattern is to first show a common way in which code can be problematic and to then show how a particular technique can be used to improve the situation. Each section within the chapters is designed to be relatively self-contained, and my hope is that they can provide a useful reference for anyone wishing to explain a particular concept or consideration to another engineer (for example, during a code review).

Please note that the list of topics within each chapter is not exhaustive. For example, chapter 7 discusses six specific topics for making code hard to misuse. This is not to suggest that these are the only six things we ever need to consider in order to make our code hard to misuse. But the aim is that by understanding the reasoning behind these six things, in combination with the more theoretical things we learned in part 1, we’ll be able to develop a broader sense of judgment that can guide us in whatever scenario we might find ourselves.