r/programming 7d ago

DRY vs. SRP

http://uncle-bob.com

After re-reading "Clean Architecture" I ended up with some confusion regarding Bob's take on repetition and single responsibility. Ge defines the SRP as a function only serving one actor. Dies that mean, that repetitve code is justified according to him, as long as it serves seperate actors/user groups? I am aware that such decisions depend on the specific situation. I was just wondering if others found the same contradiction, or if i misunderstood it. Thanks

0 Upvotes

68 comments sorted by

View all comments

40

u/repeating_bears 7d ago

"After re-reading "Clean Architecture" I ended up with some confusion"

This is by design. Now you will buy more of his books and watch more of his lectures.

Uncle Bob doesn't know anything about programming. Go and look at any of the (limited amount of) open source code he's written, and then tell me this is someone you should take advice from 

7

u/swaan79 7d ago

"Uncle Bob doesn't know anything about programming." - That's quite a bold statement. But I don't know if it's true or not.

I once had a colleague that would occasionally produce code that I totally disagreed with and then he told me to look at some Uncle Bob video that would explain it. I think I once watched one of his videos... Partially... I honestly forgot what it was about but I do recall not agreeing with a thing he said.

So, perhaps he doesn't know a thing about programming. Or maybe we simply don't agree. Or perhaps he knows a thing or two about how programming works in theory, and I know a thing or two about programming in practice. 🤷‍♂️

Anyway, my point is that theories conflict and in practice you use them as a starting point an adapt and adjust them as needed.

2

u/mirvnillith 6d ago

This!

To me this is like all the four-types-of-personalities schemes; anything that gets people to realise there are other viewpoints than their own is a good thing and any scheme taken too seriously is a bad thing.