Re: [patch 2.6.13-rc3] i386: clean up user_mode macros
From: Linus Torvalds
Date: Mon Jul 25 2005 - 18:16:26 EST
On Mon, 25 Jul 2005, Chuck Ebbert wrote:
> Recent patches from the Xen group changed the X86 user_mode macros.
> This patch does the following:
> 1. Makes the new user_mode() return 0 or 1 (same as x86_64)
I _really_ prefer
x != 0
since double negation is not only a bad habit in natural languages, it's a
bad habit in computer languages too, for exactly the same reason. It's
Ask a hundred random C programmers what "!!x" means, versus what "x != 0"
means, and time their replies.
I will bet you $5 USD that even if they all give the right answer (and I
suspect you'll get a few wrogn answers in there too for the !! case),
they'll take a _lot_ longer answering the "!!x" version than they will the
"x != 0" question.
And guess what? That means that the "!!x" version is worse. It means that
people don't "see" what it means - they have to think about it. And you
shouldn't have to think about something like that, you should write it in
the obvious way in the first place.
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/