Even if you make them up yourself, acronyms should be treated as words like any other words used in Java names.  There is no need to keep them in upper case.  Consider how ugly the acronym “TCP/IP” looks in the following example if the English language acronymn rule is followed to the letter.

package com.playpen.TCP_IP;
public class TCP_IPManager
{
    :
    public static final int MAX_TCP_IP_CLIENTS = 100;
    public TCP_IPConnection getConnection(long msecsTCP_IPTimeout)
    {
        :
    }
}

Name the TCP/IP related variables and methods like the rest of the code, treating it as one word.

package com.playpen.tcpip;

public class TcpipManager
{
    :
    public static final int MAX_TCPIP_CLIENTS = 100;
    public TcpipConnection getConnection(long msecsTcpipTimeout)
    {
        :
    }
}

This works fine for most acronyms, even two letter ones.  For single letter acronyms or words, try not to use them at all – find a longer alternative.

English language upper case acronymn conventions do not translate well into Java, so treat them as words.

blog comments powered by Disqus