Reading List

Should We Follow The Open-Closed Principle? from The Valuable Dev RSS feed.

Should We Follow The Open-Closed Principle?

When I first heard about the SOLID principles as a young and innocent developer, many of them seemed confusing to me. The Open-Closed Principle looked easy, however: we should extend the behavior of our classes instead of modifying them. I did extend the behavior of my classes indeed! Mainly by using inheritance in one form or another. The end result? An abstracted mess, where everybody was wondering what was the use cases my code was covering, hidden under a cheer amount of abstractions and indirection.