News for hackers. Stuff that matters.
Re:It's probably time to stop recommending Clean Code by notreallyserio on Friday November 12, 2021 @03:51PM (#29204381)
I just don't understand how 100 lines comprising 10 or 20 functions in the same file (as in the cited example) is any different than 100 lines of a single function that does the same thing. Is it just that the former has one fewer tab per line?

This is the sort of advice that can quickly become a thought terminator because the writer has so much authority.

Re:It's probably time to stop recommending Clean Code by ajuc on Friday November 12, 2021 @04:03PM (#29204507)
The difference is that 1 big functions naturally encodes the ordering and dependencies between things that happen inside - because it's linear and has nested braces.

10 or 20 small functions with no nesting inside still has all the complexity, but none of the structure to help programmer understand it.

Functions can be called in any order, any number of times, and you have to trace the full call-stack in your mind and keep it there to get the same understanding of what happens that you had just by looking at the linear code.