LKML Archive on lore.kernel.org
 help / color / 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)
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 index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-25 22:59 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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git