public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Larry McVoy <lm@bitmover.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Larry McVoy <lm@bitmover.com>,
	davej@redhat.com, torvalds@osdl.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.sourceforge.net
Subject: Re: [PATCH] CodingStyle fixes for drm_agpsupport
Date: Mon, 11 Aug 2003 10:23:33 -0700	[thread overview]
Message-ID: <20030811172333.GA4879@work.bitmover.com> (raw)
In-Reply-To: <3F37CF4E.3010605@pobox.com>

On Mon, Aug 11, 2003 at 01:15:58PM -0400, Jeff Garzik wrote:
> >	if (expr) statement;		// OK
> 
> The test and the statement run together visually, which is it is 
> preferred to put the statement on the following line.

Nah.  

	if (!p) return (whatever);
	if (foo) {
		statement;
	} else {
		statement;
		statement;
	}
	if (!p) return (whatever);

Perfectly readable.  We have a few hundred thousand lines of code written
like this and I review all of it.  I suspect that I do more reviewing than
99% of the people on this list which makes my opinion count more because
anything that makes my tired eyes absorb the info faster is a good thing.
Same for your eyes when you get to my age.  

I also make people do

	if ((a <= B) || (c >= d)) {
		xxx
	}

even though I know, if I think about it, what the precedence is.  It doesn't
matter that I know or you know, what matters is the number of lines of code
a day you can correctly review.  Anything that helps that means that you 
are helping people make the source base better.  Try reading 30K lines of 
diffs at one sitting and tell me again that I'm wrong.  If you do, bump it
up to 60K lines :)

> >	if (!pointer) return (-EINVAL);
> >
> >Short, sweet, readable, no worries.  
> 
> return is not a function ;-)

See, there is that age thing again.  Think V6.  And it is sort of a function,
it unravels the stack frame.
-- 
---
Larry McVoy              lm at bitmover.com          http://www.bitmover.com/lm

  reply	other threads:[~2003-08-11 17:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11 15:59 [PATCH] CodingStyle fixes for drm_agpsupport davej
2003-08-11 16:40 ` Larry McVoy
2003-08-11 16:58   ` Jeff Garzik
2003-08-11 17:04     ` Larry McVoy
2003-08-11 17:15       ` Jeff Garzik
2003-08-11 17:23         ` Larry McVoy [this message]
2003-08-11 17:53           ` Jeff Garzik
2003-08-11 17:59             ` Larry McVoy
2003-08-11 18:11               ` Jeff Garzik
2003-08-11 19:09               ` [Dri-devel] " Philip Brown
2003-08-12 12:07                 ` Peter "Firefly" Lund
2003-08-12 10:00             ` Werner Almesberger
2003-08-13 19:44               ` Jamie Lokier
2003-08-14 14:21       ` Eli Carter
2003-08-14 14:47         ` Larry McVoy
2003-08-14 15:18           ` Eli Carter
2003-08-14 15:28             ` Larry McVoy
2003-08-14 19:01               ` Gene Heskett
2003-08-14 18:43           ` [Dri-devel] " Philip Brown
2003-08-14 18:59             ` Randy.Dunlap
2003-08-14 20:16             ` Larry McVoy
2003-08-14 20:21               ` Eli Carter
2003-08-14 20:22                 ` Larry McVoy
     [not found] <jnSd.6CM.1@gated-at.bofh.it>
     [not found] ` <jo20.6MB.31@gated-at.bofh.it>
     [not found]   ` <jouY.7jw.9@gated-at.bofh.it>
     [not found]     ` <jov3.7jw.37@gated-at.bofh.it>
     [not found]       ` <joEI.7s9.9@gated-at.bofh.it>
     [not found]         ` <joOj.7Aj.11@gated-at.bofh.it>
     [not found]           ` <jphi.85s.1@gated-at.bofh.it>
     [not found]             ` <jphn.85s.17@gated-at.bofh.it>
2003-08-12  9:52               ` Ed Cogburn

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=20030811172333.GA4879@work.bitmover.com \
    --to=lm@bitmover.com \
    --cc=davej@redhat.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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