mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miles Bader <miles@lsi.nec.co.jp>
To: David Howells <dhowells@warthog.cambridge.redhat.com>
Cc: Andrew Morton <akpm@digeo.com>, Jeff Garzik <jgarzik@pobox.com>,
	dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PAG support only
Date: 14 May 2003 19:01:51 +0900	[thread overview]
Message-ID: <buok7ctu9rk.fsf@mcspd15.ucom.lsi.nec.co.jp> (raw)
In-Reply-To: <18809.1052905491@warthog.warthog>

David Howells <dhowells@warthog.cambridge.redhat.com> writes:
> So you'd rather have:
> 
> 		if (pag > 0)
> 			return vfs_join_pag(pag);
> 		else if (pag == 0)
> 			return vfs_leave_pag();
> 		else if (pag == -1)
> 			return vfs_new_pag();
> 		else
> 			return -EINVAL;
>
> Than:
>
> 		if (pag > 0)		return vfs_join_pag(pag);
> 		else if (pag == 0)	return vfs_leave_pag();
> 		else if (pag == -1)	return vfs_new_pag();
> 		else			return -EINVAL;
>
> When the former is _far_ less readable at a glance?

Keep in mind that `readable' also means that someone used to the
kernel's coding style, but not to your particular portion, should
naturally be able to follow the code with as little trouble as possible.
While I agree that your second example is more clear once one sees
what's going on (and it's certainly prettier in some sense), the `shape'
is unusual, so it takes some adaptation on the part of the reader to
make this jump, and that's something to be avoided if possible.

My personal feeling is that (1) there are exceptional cases where the
rules should be broken, and (2) but not that many.

These exceptional cases usually stick out like a sore thumb, and if
there's any doubt, it's probably not one.

-Miles
-- 
We live, as we dream -- alone....

  parent reply	other threads:[~2003-05-14  9:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030513175240.6313ea92.akpm@digeo.com>
2003-05-14  9:44 ` David Howells
2003-05-14 10:00   ` Andrew Morton
2003-05-14 10:01   ` Miles Bader [this message]
2003-05-14 16:04 Chuck Ebbert
2003-05-14 16:20 ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2003-05-13 16:33 David Howells
2003-05-13 16:48 ` Jeff Garzik
2003-05-13 20:37 ` Christoph Hellwig
2003-05-14  8:17   ` David Howells
2003-05-14  8:39     ` Christoph Hellwig
2003-05-14  4:57 ` Muli Ben-Yehuda
2003-05-14  9:54   ` David Howells
2003-05-14 12:35     ` Muli Ben-Yehuda
2003-05-14 13:17       ` David Howells

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=buok7ctu9rk.fsf@mcspd15.ucom.lsi.nec.co.jp \
    --to=miles@lsi.nec.co.jp \
    --cc=akpm@digeo.com \
    --cc=dhowells@redhat.com \
    --cc=dhowells@warthog.cambridge.redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles@gnu.org \
    /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

all inboxes | Powered by JetHome®