4 ms·
Indeed! More generally, functions are not only about abstraction, but also about decomposition. The only thing that may hurt readability is when the decomposi
by vog 10y ago
Indeed!
More generally, functions are not only about abstraction, but also about decomposition.
The only thing that may hurt readability is when the decomposition itself is too much nested. Usually, it's best to split a large task purely linearly in subtasks (functions), and have them called all from a single function. That main task function gives you not only an overview of all sub tasks, but also about the dataflow between them.
In constrast, too much subtask nesting (subtasks of subtasks of subtasks) often hide the overall flow, which then makes it hard to get the overall view.