All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Kenneth Aafl?y <lists@kenneth.aafloy.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Coding style: mixed-case
Date: Tue, 5 Apr 2005 19:09:29 -0700	[thread overview]
Message-ID: <20050406020929.GJ25554@waste.org> (raw)
In-Reply-To: <200504060329.21469.lists@kenneth.aafloy.net>

On Wed, Apr 06, 2005 at 03:29:21AM +0200, Kenneth Aafl?y wrote:
> Hi,
> 
> while reading Documentation/CodingStyle for the nth time, I realized that I had
> read some conflicting coding style in some patch posted to the linux-kernel
> mailing-list; in include/linux/page-flags.h, there is a lot of defines that are
> apparently frowned upon:
> 
> HOWEVER, while mixed-case names are frowned upon, descriptive names for
> global variables are a must.  To call a global function "foo" is a
> shooting offense.
> 
> Are those an exception to the rule or would for example
> PF_LOCKED/pf_locked be a nice replacement for PageLocked?

While there may be reasons why mixed case is suboptimal, the real
reason is that it's hard to keep track of which style is used where.
It's annoying and error-prone to have to remember the naming format
for everything in addition to its name. As most things are in a
standard style, things are made easier by having every piece of new
code follow that style and let us slowly approach uniformity.

If you posted a patch for pf_locked() and friends (and note that it's
lowercase to match function-like usage), you'd probably find some
enthusiasts and some naysayers. Most of the naysayers would object on
the grounds of "it ain't broke", but if someone were to do it as part
of a series of more substantial clean-ups, it'd likely be accepted.

-- 
Mathematics is the supreme nostalgia of our time.

  reply	other threads:[~2005-04-06  2:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-06  1:29 Coding style: mixed-case Kenneth Aafløy
2005-04-06  2:09 ` Matt Mackall [this message]
2005-04-06  2:37   ` Kenneth Aafløy
2005-04-06  9:01     ` Nick Piggin
2005-04-06 12:22       ` Hugh Dickins

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=20050406020929.GJ25554@waste.org \
    --to=mpm@selenic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lists@kenneth.aafloy.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.