Comment

Comment by rgbgraph

This form is basically always used for enumeration.

Might as well just do (x != y); unless you're specifically looking to guard against erroneous bitflips that would be caught by the prior (x < y), but not the former. But at that point -- it's likely your result is going to be garbage.

In essence they're the same; but one you never have to think about whether you're using it correctly.

Can anyone find a reason not to swap out (x < y) for (x != y)?

parent rgbgraph 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton