Idk, keeping things small / unit testable should still be the rule. Maybe my coworkers and I suck at “best” development practices, can’t think of a single PR in the past 20 years where I told them to make their functions bigger.
I think the issue with functions being too short tends to manifest as over-engineering/too many layers of abstraction. Also, I've definitely looked at plenty of code that went a bit crazy with breaking things out into new functions that it made it hard to read/understand
I think good/beautiful code is very much an art, and so that's why there's so few rules that don't have exceptions.
Sometimes repeating yourself is better than an over-engineered DRY solution, sometimes a one line function is great, sometimes a hundreds line function is great
bmoregeo@reddit
Idk, keeping things small / unit testable should still be the rule. Maybe my coworkers and I suck at “best” development practices, can’t think of a single PR in the past 20 years where I told them to make their functions bigger.
keithstellyes@reddit
I think the issue with functions being too short tends to manifest as over-engineering/too many layers of abstraction. Also, I've definitely looked at plenty of code that went a bit crazy with breaking things out into new functions that it made it hard to read/understand
Kina_Kai@reddit
Ultimately, this is a philosophical, not a technical argument.
keithstellyes@reddit
I think good/beautiful code is very much an art, and so that's why there's so few rules that don't have exceptions.
Sometimes repeating yourself is better than an over-engineered DRY solution, sometimes a one line function is great, sometimes a hundreds line function is great