1. 29
  1.  

  2. 14

    I feel sure that the SOLID principles belong in the “helps people who already expert at doing SOLID things, harms everyone else” category.

    • SRP: what is a “responsibility”? As the author has found out, you can have multiple answers that are all correct. My WorkflowManagerBean has a single responsibility, managing workflows. On the other hand: your map function has two responsibilities: iterating over a sequence, and applying the passed function.
    • OCP: nobody since Bertrand Meyer has given a coherent explanation of OCP. Bob Martin’s version is related to avoiding the fragile base class problem in C++; most of us aren’t doing C++. If this were the orange site, people would be ‘helpfully’ replying with descriptions of the OCP, and no two of these descriptions would be congruent.
    • LSP: the thing that confuses subclasses with subtypes.
    • ISP: if my objects have a single responsibility, why are there different interfaces to segregate?
    • DIP: if I invert dependencies twice I get back to where I started.
    1. 3

      My SOLID principal has been to “avoid OOP”. People sometimes make fun of haskell for requiring too much theory but I find that OOP requires the same level of theory to not create a foot-gun. But at least with haskell, I have something more like algebra than UML.

      For the most part, i’m preferring procedural style C++ because it’s easy to design, easy to test, fast to read, and document. Too much abstraction can hurt quite a lot and so many times OOP actually ends up complicating things more than it brings any advantage.

      1. 3

        What I’ve been slowly discovering is that OOP also requires too much theory, but internalising that theory lets me avoid all the incidental complexity that built up around OOP during the Software Engineering times. Don’t give me Java. Give me a vtable, a lookup primitive, a delegate primitive, a selector type and an object type, and I can build the OOP system I need without having to contort my design to fit the OOP system you/Sun/AT&T provided.

        1. 2

          “Give me a vtable, a lookup primitive, a delegate primitive, a selector type and an object type, and I can build the OOP system I need without having to contort my design to fit the OOP system you/Sun/AT&T provided.”

          I like the simplicity of your summary. Everything except a selector type looks familiar. What’s that?

          1. 3

            some kind of interned symbol type, like a Ruby/Smalltalk/LISP symbol or an objc selector.

    2. 3

      It’s meant to be “one thing” at the current level of abstraction, right? Which is totally subjective, but this is a design principle, so it can’t help but be fuzzy.