— Bruce Springsteen
— Bruce Springsteen
Again, we see the complimentary nature of these two definitions; they are virtual opposites! This exposes the fundamental dichotomy between objects and data structures:
Procedural code (code using data structures) makes it easy to add new functions without changing the existing data structures. OO code, on the other hand, makes it easy to add new classes without changing existing functions.
The complement is also true:
Procedural code makes it hard to add new data structures because all the functions must change. OO code makes it hard to add new functions because all the classes must change.
"— Martin, Robert C. (2008). Clean Code: A Handbook of Agile Software Craftsmanship (p. 97). Prentice Hall. Kindle Edition.
— Kent Beck, “Smalltalk Best Practice Patterns”