DEV Community

Discussion on: Solid Principles in Javascript

Collapse
 
paulosandsten profile image
Paulo Sandsten • Edited

When reading about the SRP, I see a conflict in how it is being described here versus how uncle Bob describes it in his book, "Clean Architecture"

"Of all the SOLID principles, the Single Responsibility Principle (SRP) might be the least well understood. That's likely because it has a particular inappropriate name. It is too easy for programmers to hear the name and then assume that it means that every module should do just one thing.

Make no mistake, there is a principle like that. A function should do one, and only one, thing. We use that principle when we are refactoring large functions into smaller functions; we use it at the lowest levels. But is is not one of the SOLID principles – it is not the SRP" - Uncle Bob

In the book mentioned, Uncle Bob defines it:
"A module should be responsible to one, and only one, actor"

With an actor, he mentions that it refers to one or more people who requires a change.

I really like that you are writing about SOLID and sharing. Thank you for that. I would like to hear more about your reasoning here regarding SRP.

Cheers.