KrakenDev


Here's to the crazy ones. The misfits. The troublemakers. The Swifters.

Viewing entries tagged
reference type

If You're Subclassing, You're Doing It Wrong.

Subclassing can suck. There are so many ways to get it wrong and it's so easy to fall into anti-patterns when you create such a tight coupling between two classes. Most of the time, the need for subclassing can actually be replaced by abstraction through protocol-oriented, value-oriented, and functional programming. In fact, I may even argue that doing it that way can far outweigh the "benefits" of subclassing the majority of the time.