|Syntactic Confectionery Delight|
Re: loop array excluding some elementsby Discipulus (Monsignor)
|on Mar 08, 2018 at 18:15 UTC||Need Help??|
you are looking for wisdom, not for elegance! ;=)
Elegance can be your enemy: better looking for efficiency and readability.
If your do_something is short as print you can consider also the unless postscript form:
It's an handy and readable syntax.
If the loop is complex and actions are more, something very similar to your example is a wise form to express some logic: a good principle exit loop early
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.