News for hackers. Stuff that matters.
Re:CUPID – the back story by sorokod on Sunday March 21, 2021 @12:37PM (#26531659)
The author rejects "Single Responsibility Principle" as “Pointlessly Vague" and offers instead the “Fits In My Head” principle. That is apparently better due to some hand wavy discussion which leaves no room to explain why same hand wavy justification would not apply to original.

stopped reading after that.

Re:CUPID – the back story by jonnypotty on Sunday March 21, 2021 @12:48PM (#26531763)
I think it's saying simple, dogmatic rules aren't a good idea and don't reduce complexity. Trusting a dev to not write functions that are unreasonably complex IS a good rule if you spend the time to check and review code.

Fitting your code around a load of "best practices" will basically always increase complexity because you've expanded the list of requirements the code has to conform to.

Re:CUPID – the back story by sorokod on Sunday March 21, 2021 @12:52PM (#26531788)
I don't think these principles are dogmatic, they rather give you a direction. Can you see that the rule "your code should have single responsibility" is more specific then "write simple code" ?
Re:CUPID – the back story by herval on Sunday March 21, 2021 @01:04PM (#26531892)
How is “fits in my head” not dogmatic, though?

And how does fitting around practices necessarily increase complexity? If you’re a jr engineer used to write a mess of code to solve a problem, and have to decompose it following a set of principles, you may end up with something SIMPLER very easily.

The whole point about principles is they lead to better outcomes. Problems arise when you confuse them with “rules that can’t be broken” or (as in this post’s case) just refuse to understand them and come up with your own half-assed heuristics - either to justify your code, for lack of experience, or just... to talk at a conference :-)

Re:CUPID – the back story by burade on Sunday March 21, 2021 @01:00PM (#26531853)
It's a good point though. Who decides what "one reason to change" is? a 10-line method could easily have hundreds of reasons to change.
Re:CUPID – the back story by TuringTest on Sunday March 21, 2021 @01:06PM (#26531915)
I think the point is that you wouldn't apply those hundreds of reasons all at once. But it your code is doing two things, you could end up having two reasons to change it at the same time.
Re:CUPID – the back story by sorokod on Sunday March 21, 2021 @01:11PM (#26531957)
You the programmer do. Do you expect everything to be automated by successive application of precise rules?
Re:CUPID – the back story by garethrowlands on Sunday March 21, 2021 @12:55PM (#26531821)
"This article isn’t about those principles, that will be my next post."

The article does not present an alternative to SOLID, that's the next article.

Re:CUPID – the back story by sorokod on Sunday March 21, 2021 @01:10PM (#26531942)
...and the linked slides