Quote:
Originally Posted by GeeTwo
For an example where the simpler code is not easier to read:
Logically, you want to do a conditional:
if (c is between a and b, and you don't know whether a is larger or smaller than b) then...
Human simpler (use this!):
if ((a<b) && (b<c) || (a>b) && (b>c)) then..
Probably machine quicker, but don't use:
if ((a-b)*(b-c) > 0) then..
|
Either your code is wrong, or your prose description is.
I guess neither is simpler.