identifier

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

identifier

An identifier is a name you give to a variable, a function, a class, a function's parameter, or any other object you need to refer to.

Identifiers need to follow a certain set of rules. These are pretty consistent across mainstream languages.

  1. Identifiers can only contain letters, numbers, and underscores.
  2. Identifiers cannot start with a number.
  3. Identifiers are case sensitive (so player and Player are different identifiers).

Additionally to syntax rules, there are some conventions about identifiers.

Usually:

For example, Player or PlayerInventory. We call that type of writing "Pascal case", because an early language, "Pascal", used this style.

GRAVITY or MAX_SIZE. We call that type of writing "screaming snake case" or simply "uppercase".

This convention helps distinguish different types of identifiers, but in most modern languages, it is not enforced.

In Godot, some people write variables in "camel case", a variant of "Pascal case" that keeps the first letter lower-case, like healthAmount. This is because that's the convention in many other languages, and some people feel more comfortable this way.

It is all ok! At GDQuest, we try to stick to the language's convention, so we use snake case.

Picking a useful identifier

You usually want your identifiers to be as unambiguous as possible. Where possible, try to make them precise, specific, and not repeated elsewhere.

Do not abbreviate; for example, total_amount is much clearer than ta. You'll find some old programmers like to abbreviate, because not so long ago, the number of letters that could be displayed on screen was limited, and the amount of letters used actually mattered. We're very far from those days today, and we have autocomplete, so don't be afraid of using long identifiers!

For any identifier that is a boolean, try to use is_ or do_. For example, act is not as clear as is_acting.

For any list of items, it's better to use items_list rather than items. items is very close visually to item, and it's easy to forget the s and make a mistake.

The more precise you make identifiers, the better. You can name a function get_player_information_if_logged_in(), which captures a lot of information about the function, compared to get_player_information(). Yes, it's long, but who cares?

Remember you spend much more time reading code than writing code. So optimize for that!

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!