docs/reference/scripting-languages/painless/painless-identifiers.md
Use an identifier as a named token to specify a variable, type, field, method, or function.
:::{important} Identifiers cannot be keywords. Using a keyword as an identifier will result in a compilation error. :::
Identifiers are the names you give to elements in your code. They must follow specific naming rules and provide meaningful names that clearly describe their purpose.
ID: [_a-zA-Z] [_a-zA-Z-0-9]*;
myVar and MyVar are different)Variations of identifiers
a <1>
Z <2>
id <3>
list <4>
list0 <5>
MAP25 <6>
_map25 <7>
Map_25 <8>
Choose meaningful identifier names that clearly describe their purpose:
// Good: descriptive and clear
String customerEmail = "[email protected]";
int totalPrice = calculateTotal();
boolean isProductAvailable = checkInventory();
// Avoid: unclear or too short
String s = "[email protected]";
int x = calculateTotal();
boolean b = checkInventory();