4 ms·
I worked on a program where the management had near-religious devotion to the one return statement paradigm. It made for a bunch of unnecessary nesting and loc
by vonmoltke 14y ago
I worked on a program where the management had near-religious devotion to the one return statement paradigm. It made for a bunch of unnecessary nesting and locals just to comply. Even worse was strong resistance to using continue and break (outside of switch statements), which lead to unnecessary flagging variables on top of that.
- btilly 14y agoI would show them http://www.cis.temple.edu/~giorgio/cis71/software/roberts/documents/loopexit.txt http://www.cis.temple.edu/~giorgio/cis71/software/roberts/do... and hope it changed some minds.
- SideburnsOfDoom 14y agoIn which language was this rule enforced? See http://anthonysteele.co.uk/the-single-exit-point-law http://anthonysteele.co.uk/the-single-exit-point-law and http://anthonysteele.co.uk/returning-to-multiple-exit-points http://anthonysteele.co.uk/returning-to-multiple-exit-points