LWN.net Logo

Re: Standardizing config option naming

From:  Greg Ward <greg-hg-AT-gerg.ca>
To:  Matt Mackall <mpm-AT-selenic.com>
Subject:  Re: Standardizing config option naming
Date:  Wed, 10 Aug 2011 19:45:21 -0400
Message-ID:  <CA+rHBMh9X33DALM8zH9Ev4-WFrYYFyO328DjS6ZK1fNZBxmm3w@mail.gmail.com>
Cc:  mercurial-devel <mercurial-devel-AT-selenic.com>
Archive-link:  Article, Thread

On Wed, Aug 10, 2011 at 5:54 PM, Matt Mackall <mpm@selenic.com> wrote:
> So we've been fairly inconsistent with naming config options. It's time
> to lay down the law here. And based on existing usage, the law should
> be: no separator on new options.

+1

An interesting consequence of "no separators allowed" is that long
identifiers are hard to read. A personal guideline that I try to
follow: if it's too hard to read without separators, it's probably too
long.

<completely irrelevant digression>
(And when you let developers create arbitrarily long identifiers, some
of them do crazy things. At work, it all started with

  Tools/Java/StringUtilities/StringTransformer.java
  Tools/Java/StringUtilities/StringCollectionTransformer.java

which are not too crazy. But they naturally spawned

  Tools/Java/StringUtilities/NullRemovalStringCollectionTransformer.java

which is only slightly less insane than

  Tools/Java/StringUtilities/StringTransformerBackedStringCollectionTransformer.java

Now when you consider the presence of

  Tools/Java/StringUtilities/ToLowerCaseStringTransformer.java

it's only natural to create

  Tools/Java/StringUtilities/ToLowerCaseStringTransformerBackedStringCollectionTransformer.java

and that, of course, demands the creation of


Tools/Java/StringUtilities/TestToLowerCaseStringTransformerBackedStringCollectionTransformer.java

I'm not kidding! This stuff is for real! Who could make this up?)
</digression>

Greg

P.S. please don't flame Java developers. The poor souls, they really
don't know any better. I actually feel sorry for them more than
anything.


(Log in to post comments)

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds