1 It’s all about managing complexity


This chapter covers

  • Why software systems get more complex over time
  • The challenges of object-oriented design
  • Why we should keep improving our design over time

In 2010, I worked for a great internet company as part of a team responsible for billing. The company founder wrote the first version of the system 10 or 15 years before I joined. The logic was all in complex SQL Server stored procedures, each of which had thousands of lines of code. It was time to refactor this existing billing infrastructure into something new, and I can’t count the number of hours we spent talking to the financial team so that we could create a design that would fit all their current and future needs.

The great news is that we made it. With our new implementation, we could add new products or financial rules in hours. The financial team was very happy with us. Feature requests that in the past took weeks now took a couple of days. The quality was also much higher. Our design was highly testable, so we rarely introduced regression bugs. Even our most junior engineer could easily navigate the code and feel confident enough to make critical changes. In a word, our new design was simple.

I’ve been developing object-oriented software systems for 20 years and have learned that in an object-oriented system without a proper design, even simple things are too hard. It doesn’t have to be like this.

1.1 Object-oriented design and the test of time

1.2 Designing simple object-oriented systems

1.2.1 Simple code

1.2.2 Consistent objects

1.2.3 Proper dependency management

1.2.4 Good abstractions

1.2.5 Properly handled external dependencies and infrastructure

1.2.6 Well modularized

1.3 Simple design as a day-to-day activity

1.3.1 Reducing complexity is similar to personal hygiene

1.3.2 Complexity may be necessary but should not be permanent

1.3.3 Consistently addressing complexity is cost effective

1.3.4 High-quality code promotes good practices

1.3.5 Controlling complexity isn’t as difficult as it seems