4 ms·
> Hum, no. The purpose of a principle is that if you follow it you will very likely get a good result. If you can't communicate the principle, then it's not a
by klodolph 5y ago
> Hum, no. The purpose of a principle is that if you follow it you will very likely get a good result.
If you can't communicate the principle, then it's not a principle any more. It's just personal judgement. It's "tacit knowledge".
https://en.wikipedia.org/wiki/Tacit_knowledge https://en.wikipedia.org/wiki/Tacit_knowledge
Principles are the opposite of tacit knowledge, they are explicit knowledge.
> Being easy to understand is nowhere on it.
I don't understand what this sentence means. I don't know how to parse "on" in this context and it's unclear what "it" is.
> Why is it that everything must be dumbed down?
Are you saying that "easy to understand" means "dumbed down"? If that's what you're saying, I don't agree with that.
> If you take the GP's single paragraph that explains the principle and tries to use it to discuss a particular design, you will see that it's perfectly possible. The fact that people can't do the same if they read a paragraph less and stop at the name is not very relevant.
The paragraph was vague.
The problem is that the SRP does not help you communicate problems with code. It does not help you understand problems with code. It is too vague.
Following SRP does not help you write good code, IMO.
- marcosdumay 5y agoJust to be clear. The thread is about an academic paper about the thing, from the 70's. And you are calling it tacit knowledge?
- frozenlettuce 5y agoprogramming advice feels like reading management books: people with experience try to put into paper their gut feeling, after years of empirical experience... and the end result is, at best, not very scientific. At worst, is outright misleading for beginners (as they lack experience to judge when said advice is applicable)
- Jtsummers 5y agoThis is why everyone learning to program should start with a language like an early BASIC with limited structured programming capabilities, no real use of subroutines (goto all the things), only global scope for variables, and no modules. Suffer a bit, then you'll appreciate things like SRP and structured programming a lot more.
- bvirb 5y agoI agree! I recently read this article about how everybody misunderstands the SRP and uses it wrong: http://www.softwareonthebrain.com/2022/01/the-misunderstood-single-responsibility.html http://www.softwareonthebrain.com/2022/01/the-misunderstood-... Notably it was retweeted by the author of the SRP himself: https://twitter.com/unclebobmartin/status/1485224521875562498 https://twitter.com/unclebobmartin/status/148522452187556249... Now neither of them went this far with it: but if we have a programming principle that nobody understands or uses right, is it really all that useful? Maybe it at least shouldn't be the first one in SOLID?
- kazinator 5y agoCommunicating the principle is different from understanding code which follows the principle, or does not.