03 / 16
Naming
Follow Unreal's prefixes and PascalCase. Put units and boolean meaning in the name.
Unreal's tooling, reflection, and APIs all assume the prefix conventions. Beyond that, a name has one job at the call site: say what the value is without making someone open the header.
Type prefixes
PrefixUseExamples
AAActor descendantsACharacter, AProjectileUUObject descendants that aren't actorsUActorComponent, UItemDefinitionFStructs and most plain C++ typesFVector, FInventoryEntryEEnumsETeamAttitude, EWeaponStateIThe native half of an Unreal interfaceIInteractableSSlate widgetsSCompoundWidgetTTemplate typesTArray, TSharedPtrRules
- 01Boolean fields begin with
b. Boolean queries ask a question, such asIsAlive,HasAuthority, orShouldRespawn. - 02Procedures use a specific verb such as
EquipWeaponorRemoveExpiredEffects. Vague verbs such asHandleDataandProcessItemsrarely explain the effect. - 03Written output parameters begin with
Out. A boolean output placesbfirst, such asbOutWasAdded. - 04Include units when the type cannot express them:
DurationSeconds,DistanceCentimeters, andAngleDegrees. - 05The larger the scope, the longer a name can afford to be. A two-line local does not need the same context as a public subsystem method.
- 06Project macros use uppercase words, underscores, and a project prefix. Engine macros use
UE_. - 07An Unreal interface declares two types: a
U-prefixedUInterfaceclass that exists for reflection, and anI-prefixed native class that holds the functions. Implementations inherit theIversion. - 08Keep abbreviations to the ones the engine already uses, such as
IdxandNum. A project-specific shortening costs every new reader a lookup. - 09A boolean name states what
truemeans.bIsVisibleanswers a question;bVisibilityleaves the reader guessing which way the flag points. - 10Reserve
Getfor a cheap accessor. AGetthat runs a search or allocates misleads the caller about cost, so name itFind,Compute, orBuildinstead. - 11Name the concept, not the container.
ActiveEffectsstill reads correctly after a change fromTArraytoTSet.EffectArrayis wrong as soon as the type changes.

