3 ms·
IIRC both Dijkstra and Knuth used this approach extensively, instead of "if (some_cond) break;" — partly because the latter was not yet invented, partly because
by Joker_vD 9d ago
IIRC both Dijkstra and Knuth used this approach extensively, instead of "if (some_cond) break;" — partly because the latter was not yet invented, partly because of their reliance on explicitly stated and documented right in the code loop invariants.
- xp84 8d agoThat's fair. Let me modify my statement: If the person doing this was over 50 and had developed this habit in old languages where that was basically idiomatic, it wouldn't scandalize me - though I'd raise an eyebrow to see it in a modern language. But if someone's 28 and doing that stuff in Python or JavaScript, they're a bit of a loon, imho.