3 ms·
I disagree. I find that breaking functions into subfunctions extremely helpful to make code easier to read and understand and follow, and consequently to track
by rualca 6y ago
I disagree. I find that breaking functions into subfunctions extremely helpful to make code easier to read and understand and follow, and consequently to track and fix bugs.
Extracting functions does way more than removing descriptive comments. When you extract a function, you're compartmentalizing code and adding scopes where none existed and limit contexts. When you extract a function, you're explicitly constraining a block to comply with a contract, which allows you to not care what goes below that point. You just care about pre and post-conditions, and that is more than enough to troubleshoot and fix bugs, and more importantly not add them.