Hello and welcome to the GDScript fundamental tutorial series.
In this episode, I go over naming conventions in Godot GDScript.
Naming conventions are a set of rules for choosing the character sequence to be used for identifiers which denote variables, functions, classes, and other entities in source code.
# variable name is a single character
var x = 100
# unsearchable name, the name has no meaning
var x1 = 100
# never include data types inside a name
var intHealth = 100
# variable name is a single character
var x = 100
# better variable name
var playerHealth = 100
# even better variable name, explains intent
var playerHealth: int = 100
Consider using the following:
var camelCase
.const SNAKE_UPPERCASE
func camelCase:
Godot has an official naming convention-style guideline that you can follow as well: