Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

> x <= y is the same as !(x > y)

i.e. two tests, or perhaps i should say logical operations. i'm not saying don't use '<=', but do check that it is doing what you think it should.



Let me put it another way: the following are the same code:

if: x <= y, do: foo(), else: nothing()

if: y < x, do: nothing(), else: foo()


Shouldn't the last statement be:

if: y > x, do: nothing(), else: foo()


Nope, order of evaluation might matter with impure code.


How exactly? Well there is an extreme case where x and y are volatile but even then the order is implementation defined so I can't see a world where it matters.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: