DEV Community

Discussion on: Understanding SOLID: Single Responsibility Principle

Collapse
 
phantas0s profile image
Matthieu Cneude

I saw too many developers (myself included) writing classes with one method each because of the SRP. That's not great. On top of that, in practice you'll have no clue who's is responsible for what in a company, and in a startup the CTO can do many, many things, for example. What do you do in that case? Create a god class?

It's more important for me to understand why the SRP was created and by what it was inspired. If you want another view on the SRP, I wrote about it here: thevaluable.dev/single-responsibil...

Collapse
 
nomikz profile image
nomikz

Creating a class with just a single method is totally fine for me.
Overengeenering is another talk.

Collapse
 
tamerlang profile image
Tamerlan Gudabayev

Hi, really appreciate the feedback. What your saying is indeed correct, and SRP is merely a principle that shouldn't be always followed 100% to the brim.

Collapse
 
themelis profile image
Themelis

What a great article that was Matthieu. Thank you very much!

ps: Robert Martin is really charismatic :D

Collapse
 
phantas0s profile image
Matthieu Cneude

Glad you liked it! Robert Martin is more and more controversial in the industry: some hate him, some love him. Personally, I just think his opinion is often way too absolute.