Re:Notes from an Interviewer
by diarrhea on Saturday February 24, 2024 @09:19AM
(#39491654)
Only ones I ever found worthwhile are D and maybe I.
[ Parent
| on HN ]
Re:Notes from an Interviewer
by tetromino_ on Saturday February 24, 2024 @09:55AM
(#39491877)
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.
But 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?
The 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.
Re:Notes from an Interviewer
by mytailorisrich on Saturday February 24, 2024 @09:21AM
(#39491667)
S (Single responsibility principle) is very important, not only for OOP but for good, maintainable software design in general (yes, even if you do firmware stuff).
Absolutely. I just find it rather inactionable, as it can be subjective.
Re:Notes from an Interviewer
by mytailorisrich on Saturday February 24, 2024 @11:10AM
(#39492630)
Odd because that's arguably the easiest to apply when designing software.