4 ms·
IME, SOLID is only an important idea because there are so many ways to do OOP poorly and you need a set of guidelines to help you not turn your OOP codebase int
by ninkendo 3y ago
IME, SOLID is only an important idea because there are so many ways to do OOP poorly and you need a set of guidelines to help you not turn your OOP codebase into a mess.
You get most of SOLID automatically if you just don’t do implementation inheritance. Many great languages don’t even support it in the first place, and that’s a good thing as it’s a massive footgun. That obviates 3 of the 5 SOLID principles right there: just don’t do implementation inheritance. (Interfaces are ok, just not base classes, ie. Use “implements” but not “extends” in Java, etc.) The other two principles are mostly just common sense anyway.
Or heck, maybe just don’t do OOP, as it’s not clear to me that it’s the right approach in the vast majority of circumstances. Make your data first class and design algorithms that work on it, keeping your logic and data firmly separated, and you sidestep the whole issue.