News for hackers. Stuff that matters.
Re:Loop Exits and Structured Programming: Reopening the Deba... by taneq on Monday June 12, 2017 @09:39PM (#14542388)
Nested if-statements lets you avoid re-evaluating the conditions between if-statements. Short-circuit evaluation only partially addresses that.

It can be cleaner to cache the conditions in a few flags if you want to do it that way, though. I'm not saying deeply nested conditionals are pretty, just that there are some cases where they're quicker. (Of course, if you're scraping the bottom of the barrel for that kind of speedup then chances are, there are algorithmic improvements that will yield orders of magnitude more gains.)

There are no comments on this comment yet.