|
|
Warp wrote:
> (OTOH, one could argue that understanding "0 < money" becomes easy when
> you use it a lot...)
Yes, it takes practice.
> The form you suggest becomes a bit counter-productive when the expression
> is not a pure "between x and y", like for example:
>
> if(10 < money*money && money*12 < 100)
>
> Now it becomes much harder to understand quickly what's going on.
If money squared is more than ten or money times twelve is less than a
hundred. Makes sense to me. :-) But then, I'm used to it.
I've noticed since this came up that I'll even do things like
if (i > 0^H^H^H^H^H0 < i) ....
> In most cases the compiler will issue a warning anyways if you make
> the mistake. Never been a problem to me.
It depends on the language, and the compiler. A lot of embedded
compilers aren't too smart, and a lot of languages that adopted C syntax
(PHP, Java, etc) aren't too smart about that too.
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
|