3 ms·
The only part of SOLID that is unquestionably correct is "L" - it is the only sane way to use subclassing in OO languages. "D", when used judiciously, can be u
by tetromino_ 3y ago
The only part of SOLID that is unquestionably correct is "L" - it is the only sane way to use subclassing in OO languages.
"D", when used judiciously, can be useful because it can make unit tests much easier to write. But when used too much, it results in incomprehensible code.
But as for "I", in my humble opinion, when you find yourself reaching for it, it's a sign that the code base is already poorly organized.
- fhars 3y agoBut the L part is only correct in so far as it repeats the definition of what it means to be a subtype, i.e. it is vacuously true. BY the way, does any OO language apart form Ocaml get this right?
- ahtihn 3y agoThe L part was apparently not so obvious to the authors of the Java standard library since it has violations all over it. Readonly implementations of java.util.List come to mind.