Re: Short-circuit warning
- Posted by Jason Gade <jaygade at y?hoo.c?m> May 20, 2008
- 625 views
Andy Drummond wrote: > When I first used Euphoria the docs DID describe the short-circuiting process. > It was very clear, and made coding easier with things like: > }}} <eucode> > if atom(res) or length(res)=0 or res[1]='+' then > do something > end if > </eucode> {{{ > To do that with three nested if statements would be silly. As is the process > of hiding side-effects within if statements. An if statement is a condition > testing statement, and just because you CAN hide assignments within it hardly > makes for clear coding and good practice. > So please stick with short-circuiting if statements and recommend that users > do actually read the original Euphoria documentation first. No one is talking about doing away with short circuiting. We're talking about whether there should be a warning in the short circuiting case. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.