3 ms·
onClick => onAccept => submitRequest The downside is lots of little functions, the plus side is smaller behaviors. (Ie avoiding 5 levels of nesting in a single
by Forge36 6y ago
onClick => onAccept => submitRequest
The downside is lots of little functions, the plus side is smaller behaviors. (Ie avoiding 5 levels of nesting in a single function.)
- MattRix 6y agoThis sort of thinking leads to codebases that are too abstract, where it’s hard to follow the flow of execution. There’s nothing wrong with 5 levels of nesting. It’s much easier to follow than 5 separate functions.
- Forge36 6y agoDepends on the size of the function. If these are literal one liners: don't break them up. When they are shared between multiple pieces it's more useful. Ie: submit request has multiple callers.