Discussion and voting: Coding convention : getLdapUrl or getLDAPURL ?

Andrew Petro apetro at unicon.net
Fri May 17 00:08:07 EDT 2013


Joshua Bloch wrote in the first edition of Effective Java, (c) 2001: "There
is little consensus as to whether acronyms should be uppercase or have only
their first letter capitalized.  While uppercase is more common, a strong
argument can be made in favor of capitalizing only the first letter.  Even
if multiple acronyms occur back-to-back, you can still tell where one word
starts and the next word ends.  Which class name would you rather see,
HTTPURL or HttpUrl?"

I'd say that since 2001 there's more consensus on preferring HttpUrl over
HTTPURL.

SamlBindingContext seems to be the consensus here:
http://stackoverflow.com/questions/1176950/acronyms-in-camel-back , and the
advice here: https://blogs.oracle.com/tor/entry/code_advice_3_don_t , and
the example Java naming conventions in Wikipedia:
http://en.wikipedia.org/wiki/Naming_convention_(programming)#Java , and the
AmbySoft coding convention (
http://www.ambysoft.com/downloads/javaCodingStandards.pdf , 1.3 # 7).

Some IDEs may provide shortcuts that work for HttpSoapDecoder, but not
HTTPSOAPDecoder, cf.
http://stackoverflow.com/questions/2236807/java-naming-convention-with-acronyms,
IDE shortcuts relying upon CamelCase also mentioned in the Wikipedia
article.

Hope this helps,

Andrew




On Thu, May 16, 2013 at 10:21 PM, Brent Putman <putmanb at georgetown.edu>wrote:

> Tom reminded me that after the last dev call I was supposed to start a
> thread to discuss this issue and bring it to a vote.  So here it is.
>
> In terms of my opinion, I think that:
>
> 1) We should adopt a consistent convention, both within and between our
> (new V3) projects.
>
> 2) If there is evidence for a "Java standard" here, that should probably
> inform what we do.  Our cursory look at the JavaBeans spec seemed
> uncover that it is a little ambiguous on this point; I think we should
> probably research a little further before declaring there isn't an
> official position.
>
> 3) We've got work to do either way.  Perhaps more with one decision than
> the other.  However, we're talking about mechanical "easy" work (as
> opposed to work that requires real thought), and in either case I doubt
> it's more than a couple of dozen-ish man-hours, presumably to be split
> up amongst several people.  So my $.02 is that we shouldn't base the
> decision on the perceived amount of work involved, but rather on what we
> think is "right".
>
> 4) I don't have a strong aesthetic opinion either way.  Like Scott my
> initial inclination was to say that acronyms are more naturally all
> uppercase, b/c they just are.  However, it does look bad when you have 2
> or more in a row.  Since we've been using the camel case for the new
> stuff for quite awhile now, I've grown used to it also, and at this
> point I don't think it looks unusual or unnatural.  It is in fact
> somewhat easier on the eyes.
>
> 5) Don't forget this issue pertains not just to method names but also
> class names (e.g. HTTPSOAP11Decoder, SamlBindingContext).
>
>
> So discuss away.
>
> --Brent
>
>
>
> --
> To unsubscribe from this list send an email to
> dev-unsubscribe at shibboleth.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20130517/c785caec/attachment.html 


More information about the dev mailing list