DEV Community

loading...

Discussion on: Solid. Is It Still Useful In 2021?

Collapse
leob profile image
leob • Edited

My opinion is that these 5 principles are not all on the same "level". Some of them seem quite 'specific' - heavily geared towards classical OO (think Java, or C++).

The one that I think is most useful, still, in 2021, is the most generic one (and the one that's least tied to "classic OO"):

"Single Responsibility"

I'd say that this one is (almost) always useful, regardless of the programming language or paradigm you're using (like OO, FP, and so on).

The more a principle is tied to the specific "classical OO" paradigm, the least relevant it still is in 2021. Well that's what I think :-)

Collapse
andrewbaisden profile image
Andrew Baisden

Agreed well said.

Collapse
anicholson profile image
Andy Nicholson

These idea still apply in FP JS:

Every time we call connect() to wire up a React component to Redux or similar, we’ve just practiced dependency injection (props are injected dependencies) & single responsibility (component is not responsible for sourcing its own data).

Similarly, passing in callback functions to a component is following Open/Closed, as you’ve extended without modifying.

Collapse
leob profile image
leob

Great examples!

Forem Open with the Forem app