4 ms·
Yes, I've seen this a lot over the years. Also, putting code inside a do ... while( false ) loop purely so you can use break as a sneaky goto to avoid deeply n
by JohnFen 4y ago
Yes, I've seen this a lot over the years.
Also, putting code inside a do ... while( false ) loop purely so you can use break as a sneaky goto to avoid deeply nested conditionals while technically adhering to the single return rule.
I think when you're starting to use control statements in bizarre ways like that, it's a good indication that maybe that's a case where breaking the "rules" is the best thing.