Re:It's probably time to stop recommending Clean Code
by Fellshard on Friday November 12, 2021 @03:17PM
(#29204044)
Only if said functions are illogically split along non-obvious boundaries. Very frequently, though, I find I can break down concepts to two-three statements in a way that makes it very concise. But also not a hard rule, because there are cases when long-and-drawn-out work as well.
[ Parent
| on HN ]
Re:It's probably time to stop recommending Clean Code
by philosopher1234 on Friday November 12, 2021 @03:21PM
(#29204082)
Even logical splits impede readability, because they require tracking and navigation during reading. Every new API has a cost.
Re:It's probably time to stop recommending Clean Code
by xboxnolifes on Friday November 12, 2021 @03:33PM
(#29204194)
I agree. If a function is only ever likely to be used in the one place it was pulled out of, you're probably better off just using a comment instead.
Re:It's probably time to stop recommending Clean Code
by dragonwriter on Friday November 12, 2021 @03:40PM
(#29204274)
> Even logical splits impede readability, because they require tracking and navigation during reading.
IME, most reading of code has a specific focussed goal for which logical splitting allows not reading lots of irrelevant code you'd have to read if it was a non-abstracted mass.
Re:It's probably time to stop recommending Clean Code
by Fellshard on Friday November 12, 2021 @05:22PM
(#29205238)
I take this approach for internal divisions within the same file. For external APIs, you're operating under a completely different set of constraints. As I recall, similar advice was in the original Clean Code: context guides which principles you apply.