Designing good quality code
Good quality code doesn’t happen by accident. It is intentional. It is the result of thousands of small decisions, each one shaping how easy our code is to read, test, compose, and change. We must choose between quick-and-dirty hacks, where we have no idea what edge cases are covered, and more robust approaches, where we are confident that no matter how the user misuses our code, it will work as expected.
Every line of source code involves at least one of these decisions. That’s an awful lot of deciding that we have to do.
You’ll notice that we haven’t mentioned TDD so far. As we will see, TDD does not design your code for you. It doesn’t remove that essential engineering sensibility and creative input that is needed to turn requirements into code. To be honest, I’m grateful for that – it’s the part that I enjoy.
However, that does cause a lot of early failure with TDD, which is worth noting...