Re: Short-circuit warning

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jeremy Cowgar wrote:
> 
> Is this warning really valid:
> 
> Warning: ../bin/indent.ex:53 - call to matches() might be short-circuited
> 
> Well, maybe valid, but useful? For instance, I specifically made the if
> statement
> to short-circuit, that's the way I want it. I program all the time counting
> on short circuits and do not really feel as though I need a warning about it.
> I thought short-circuits were a benefit?
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>

I think it was a valid warning when short-circuiting was new to Euphoria. I
guess the question is whether short-circuiting is expected behavior by people new
or relatively new to programming?

Personally, I say do away with it and make it very clear in the docs that that
is how things work.

--
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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu