Type and method names are usually not abbreviated (except for the well-accepted abbreviations such as EOF, Impl, Fifo, etc.).
Abbreviation applies to local variables, method parameters, class fields and in some cases public static fileds (constants) of the class.
Variable name should be abbreviated using table below containing mapping between longer name and its short form.
RULE 1
The variable name should be as short as possible yet to be descriptive enough in a given context.
RULE 2
The descriptiveness of the variable name should be proportional to its significance in a given context.
There is a simple custom plugin available that performs on-the-fly check of variable names and highlights incorrectly named variables.
Plugin can be downloaded from wiki: ignite-abbrev-plugin-3.0.1.jar
Source code of plugin can be found at GitHub ignite-abbrev-plugin
To install plugin to idea you can do the following steps:
1. Go to 'Settings', and to 'Plugins' section.
2. Select 'Install Plugin From Disk' and select jar from local file system.
'Apache Ignite abbreviation plugin' should appear. After Idea restart abbreviations will be highlited by editor.
Note that in some cases it is allowable to abbreviate a word to its first letter (like, for a example, when there is a naming conflict, on in a loop variables, or in a catch clause). Note also that class on instance fields should almost never be abbreviated to one letter and should use instead the common abbreviations below.
In some rare cases one-letter names can be augmented by number like in common nested catch clause example: e, e1, e2.
Widely used names in the project including specific domain area terms are summarised in the table below. It is required to use abbreviated form for code consistency.
Name | Abbreviation |
---|---|
address | addr |
affinity | aff |
argument | arg |
array | arr |
attribute(s) | attr(s) |
buffer | buf |
class | cls |
command | cmd |
config | cfg |
context | ctx |
count | cnt |
current | cur |
database | db |
default | dflt |
destination | dest |
directory | dir |
event | evt |
exception | e, e2, ex |
execute | exec |
frequency | freq |
future | fut |
group | grp |
handler | hnd |
header | hdr |
implementation | impl |
index | idx |
initial(ize) | init |
iterator | iter |
label | lbl |
local | loc |
logger | log |
loader | ldr |
manager | mgr |
message | msg |
mutex | mux |
network | net |
object | obj |
package | pkg |
parameter | param |
password | pwd |
policy | plc |
property(ies) | prop(s) |
process, processor | proc |
query | qry |
receive | rcv |
reference | ref |
regular expression | regex |
repository | repo |
request | req |
resource | rsrc |
response | res |
return value | retVal |
sender | snd |
service | srvc |
session | ses |
sequence | seq |
socket | sock |
source | src |
string | s, str |
subject | subj |
system | sys |
topology | top |
topology version | topVer |
value | val |
version | ver |