in reply to Re^2: why not listed foreach and if?
in thread why not listed foreach and if?
Because for readability and thus understandability and maintainability the important stuff should come first. A trailing if that determines if anything is performed at all makes the code much harder to understand because when you reach the if you have to revise your entire mental model of the statement to that point.
Somewhat like the infamous instructions for disarming a bomb:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: why not listed foreach and if?
by cavac (Prior) on Jun 19, 2024 at 11:49 UTC | |
by eyepopslikeamosquito (Archbishop) on Jun 19, 2024 at 13:31 UTC | |
by etj (Priest) on Jun 20, 2024 at 15:50 UTC |