The Bogus SE/SE Rule
Relatively recently, I participated in a debate with a peer regarding the sacredness of the Single Entry / Single Exit (SE/SE) “rule” of programming. I wish I had this eloquent Herb Sutter treatise on hand when it occurred:
Woot! Now that I’ve stashed the case against SE/SE nazi “enforcement” on this blawg, I’m armed and ready to confront the next brainwashed purist on the matter.
Categories: C++
Herb Sutter, programming
You know what’s even funnier?
I’ve seen people (purists/brainwashed) devs to suggest, rewriting:
int_32t sum;
for(const auto& el: vints)
{
if(el == 0)
sum = 0;
elseif(el==-1)
throw…
else
sum += el
}
return sum;
suggesting that for SE/SE variant… ahhhhh
🙂