Simple Object-Oriented Design: Create clean, maintainable applications cover
welcome to this free extract from
an online version of the Manning book.
to read more
or

8 Being pragmatic

 

This chapter covers

  • Why being pragmatic matters
  • Why you should never stop refactoring
  • Why you should never stop learning about object-oriented design

Congratulations! You’ve finished this journey through the six most important characteristics of simple object-oriented design:

  • Small units of code
  • Consistent objects
  • Proper dependency management
  • Good abstractions
  • Properly handled infrastructure
  • Well modularized

In this chapter, I discuss a few pieces of advice that I also consider essential to keep object-oriented designs as simple as possible. Some were briefly mentioned in previous chapters but are so important that I’ve dedicated a separate section to them.

8.1 Be pragmatic and go only as far as you must

It’s easy to get stuck in an infinite loop of design improvements, especially for engineers who appreciate a well-designed system. Even simple design decisions can branch out into numerous possibilities.

Striving for the best possible design is essential for a highly maintainable, simple object-oriented system. But it’s important to remember that our primary goal is not to write beautiful designs but rather to deliver functional software as efficiently as possible. A good design enables that goal, but it’s not the end. Finding the right tradeoff between exploring the perfect design and settling for a good-enough design is a challenging task that improves with experience over time.

8.2 Refactor aggressively but in small steps

8.3 Accept that your code won’t ever be perfect

8.4 Consider redesigns

8.5 You owe this to junior developers

8.6 References

8.7 Exercises

Summary