Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #1579

Re: identifier nomenclature

Date 2012-05-16 08:57 -0700
From Patricia Shanahan <pats@acm.org>
Newsgroups comp.programming
Subject Re: identifier nomenclature
References <21153887.1747.1337181462073.JavaMail.geo-discussion-forums@ynjm4>
Message-ID <t6SdnYyLqfXRUy7SnZ2dnUVZ_sidnZ2d@earthlink.com> (permalink)

Show all headers | View raw


On 5/16/2012 8:17 AM, bob wrote:
> What are some of the most common ways to convert a set of words to an identifier?
>
> For instance:
>
> a_set_of_words
>
> ASetOfWords
>
> asetofwords
>
> aSetOfWords
>
> Which do you prefer and why?

Some coding conventions use different forms for e.g. class identifiers
and method identifiers.

I like consistency more than I care about the exact rules, so I chose
according to the first applicable rule from the following list:

1. Consistency with existing code in the same program.

2. If the language has rich APIs, match the identifier rules used in the
APIs.

3. If there is a commonly used coding standard follow it.

4. In the rare case that none of the above apply, I usually just go with
the same rules as in the last program I worked on. I'm more likely to
remember those rules and apply them consistently than any new set of
rules I make up.

Patricia

Back to comp.programming | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

identifier nomenclature bob <bob@coolfone.comze.com> - 2012-05-16 08:17 -0700
  Re: identifier nomenclature Patricia Shanahan <pats@acm.org> - 2012-05-16 08:57 -0700
  Re: identifier nomenclature Jacob Sparre Andersen <sparre@nbi.dk> - 2012-05-18 10:34 +0200
  Re: identifier nomenclature Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-18 10:34 -0700

csiph-web