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


Groups > comp.lang.java.programmer > #36230

Re: Uppercase methods names

From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Uppercase methods names
Date 2017-01-30 21:20 -0500
Organization Aioe.org NNTP Server
Message-ID <o6os8o$1vbl$1@gioia.aioe.org> (permalink)
References <namens-20170131023341@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 1/30/2017 8:36 PM, Stefan Ram wrote:
>   This is not mentioned in JLS 6.1, but are
>
> public static int java.awt.Color.HSBtoRGB(float,float,float)
> public static double java.lang.Math.IEEEremainder(double,double)
> public static float[] java.awt.Color.RGBtoHSB(int,int,int,float[])
> public static long java.util.Date.UTC(int,int,int,int,int,int)
> public static native double java.lang.StrictMath.IEEEremainder(double,double)
>
>   enough prior art to derive a rule:
>
>       »When a method name starts with an acronym that usually
>       is written in all-upperase, it is still written in
>       all-uppercase when it appears at the start of a method
>       name«?

The old SUN Java coding convention:

http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-135099.html

sort of indicates that well known abbreviations are a special case:

<quote>
unless the abbreviation is much more widely used than the long form, 
such as URL or HTML
</quote>


But Google's coding convention has plenty of examples not allowing it:

https://google.github.io/styleguide/javaguide.html#s5.3-camel-case

I would say that we are out there where the discussion does not
have much practical impact.

Both HSBtoRGB and hsbToRgb should be readable.

Arne



Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

Re: Uppercase methods names Arne Vajhøj <arne@vajhoej.dk> - 2017-01-30 21:20 -0500

csiph-web