public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: gdb@sources.redhat.com
Subject: Coding style
Date: Fri, 02 May 2003 10:10:00 -0000	[thread overview]
Message-ID: <200305021010.h42AAgOQ030687@elgar.kettenis.dyndns.org> (raw)

Hi folks,

I've been noticing that some folks (most notably Andrew :-) have been
very "economical" in the use of empty lines in function bodies.  I
know that the GNU coding standards say that one should not use too
many of those, but I think there are good reasons to keep with the
tradition of seperating the declaration of local variables from
geneuine code by an empty line, e.g.:

int
max_register_size (struct gdbarch *gdbarch)
{
  struct regcache_descr *descr = regcache_descr (gdbarch);

  return descr->max_register_size;
}

instead of:

int
max_register_size (struct gdbarch *gdbarch)
{
  struct regcache_descr *descr = regcache_descr (gdbarch);
  return descr->max_register_size;
}

I keep finding the first much more legible.  AFAICT all GNU projects
that take the coding standards serious use that style.  By the way,
using whitespace to logically group lines together within a function
body is generally a good idea too.  Well, IMHO of course...

Anyway, I hope no one will object if add a few extra newlines
here'n'there when I feel it's appropriate?

Mark

             reply	other threads:[~2003-05-02 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-02 10:10 Mark Kettenis [this message]
2003-05-02 17:32 ` Joel Brobecker
2003-05-02 18:46 ` Andrew Cagney
2003-05-03  9:54   ` Richard Earnshaw

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=200305021010.h42AAgOQ030687@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=gdb@sources.redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).