Re: (0 == foo), rather than (foo == 0)

From: Bill Davidsen
Date: Thu Mar 11 2004 - 18:03:03 EST


Stefan Smietanowski wrote:

But this works: while (a = b, a != 0).
(not that it is any better readable :-) ).


My eyes! *Starts clawing them out*

All in what you are used to reading. I grew up with ranges sepcified as something like
0 <= x <= 40
in the spec, and therefore still write it like
if (0 <= x && x <= 40)
because that makes it obvious (to me) that it's a range check.

A case of the language not having a range check operator and various people finding one thing or another readable.

--
-bill
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/