linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	Vincent Hanquez <vincent.hanquez@cl.cam.ac.uk>,
	Andi Kleen <ak@suse.de>
Subject: Re: [patch 2.6.13-rc3] i386: clean up user_mode macros
Date: Mon, 25 Jul 2005 16:13:13 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0507251608430.6074@g5.osdl.org> (raw)
In-Reply-To: <200507251901_MC3-1-A589-A433@compuserve.com>



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

over 

	!!x

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 
confusing.

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.

		Linus

  reply	other threads:[~2005-07-25 23:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-25 22:59 [patch 2.6.13-rc3] i386: clean up user_mode macros Chuck Ebbert
2005-07-25 23:13 ` Linus Torvalds [this message]
2005-07-26  0:20   ` Steven Rostedt
2005-07-26  2:45     ` Lee Revell
2005-07-26  1:28   ` Miles Bader
2005-07-26  1:34     ` Andrew Morton
2005-07-26  2:31       ` randy_dunlap
2005-07-27  1:57 Chuck Ebbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0507251608430.6074@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=76306.1226@compuserve.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vincent.hanquez@cl.cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).