3 ms·
> ... makes case analysis easier ... > ...making the code look less complicated than it actually is... > I'd rather emphasize the underlying declarative inten
by brandmeyer 9y ago
> ... makes case analysis easier ...
> ...making the code look less complicated than it actually is...
> I'd rather emphasize the underlying declarative intent, the state machines, and pre/post-conditions.
So much this. The goal of refactoring code for readability is not to make it parse more like spoken language (ie, English). Its to aid in understanding and analysis. Having code layed out on the page in a way that mirrors the true control flow graph, makes understanding the CFG easier. Having a data flow graph that mirrors the control flow graph makes understanding the DFG easier.
- timoxley 9y ago> ... makes case analysis easier ... > ...making the code look less complicated than it actually is... > I'd rather emphasize the underlying declarative intent, the state machines, and pre/post-conditions. These statements are strange to me as I personally see early returns as attempts as achieving exactly these goals. I guess people unroll logic in their head in different ways. "flat" to one may appear "nested" to another and vice versa.