3 ms·
One place where nesting makes things difficult is in error handling. If at each potential error point you best one level, you quickly find yourself deeply nest
by jeremy_wiebe 8y ago
One place where nesting makes things difficult is in error handling.
If at each potential error point you best one level, you quickly find yourself deeply nested.
I find the pattern of exiting early and having the “happy path” running to the end of the scope to make it much easier to comprehend a function (I’m sure there’s a term for this coding style but I can’t find the name of it at the moment).
- oneeyedpigeon 8y agoI also find myself doing a similar thing in loops - 'continue'ing early instead of wrapping everything in conditionals.