This chapter covers
- The tendency of OOP to increase system complexity
- What makes OOP systems hard to understand
- The cost of mixing of code and data together into objects
In this chapter, we explore why Object-Oriented Programming (OOP) systems tend to be complex.
This complexity is not related to the syntax or the semantics of a specific OOP language. It is something that is inherent to OOP’s fundamental insight that programs should be composed from objects that consist of some state together with methods for accessing and manipulating that state.
Over the years, OOP ecosystems have alleviated this complexity increase by adding new features to the language (e.g. anonymous classes and anonymous functions) and by developing frameworks that hide some of this complexity by providing a simpler interface to developers (e.g. Spring and Jackson in Java). Internally, they rely on advanced features of the language like reflection and custom annotations.
This chapter is not meant to be read as critical of OOP. Its purpose is to raise awareness of the tendency towards increased complexity of OOP as a programming paradigm and to motivate you to discover a different programming paradigm where the system complexity tends to be reduced, namely Data Oriented programming.