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

From: Peter Williams
Date: Wed Mar 10 2004 - 18:10:56 EST


Richard B. Johnson wrote:
On Wed, 10 Mar 2004, Randy.Dunlap wrote:


On Wed, 10 Mar 2004 11:46:40 +0530 Godbole, Amarendra \(GE Consumer &
Industrial\) wrote:

Hi,

While writing code, the assignment operator (=) is many-a-times
confused with the comparison operator (==) resulting in very subtle
bugs difficult to track. To keep a check on this -- the constant
can be written on the LHS rather than the RHS which will result
in a compile time error if wrong operator is used.



People who develop kernel code know the difference between
'==' and '=' and are never confused my them.

And you never make typing mistakes? That's admirable or should I say incredible.

If you make
contributions to kernel code, and write: "if (0==foo)", your
code will be reviewed until it is obsolete and never find
its way into the kernel. Please don't insult kernel developers
with this kind of kid-stuff.

People who develop kernel code also know what a line-warp is.
They put a '\n' "[Enter] key" in their text every so-often,
maybe every 70 to 79 characters...

Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.


-
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/


--
Dr Peter Williams, Chief Scientist peterw@xxxxxxxxxx
Aurema Pty Limited Tel:+61 2 9698 2322
PO Box 305, Strawberry Hills NSW 2012, Australia Fax:+61 2 9699 9174
79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com

-
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/