VerseWiki
VerseWiki
  • Table of Contents
  • Import Expressions
  • 01. Common Naming Patterns
  • 02. Names
  • 03. Formatting
  • 04. Functions
  • 05. Failure Checks
  • 06. Encapsulation
  • 07. Events
  • 08. Concurrency
  • 09. Attributes
  • 10. Constructors
  • 11. Class & Specifiers
  • 12. Math
  • 13. Containers
  • 📘Fortnite Digest
  • 📗Unreal Engine Digest
  • 📕Verse Digest
  • EG: Onboarding Guide
  • EG: Verse Programming
  • EG: Language Reference
  • EG: Official API
  • EG: Verse Scripting
  • EG: Dev Community
  • EG: Community Snippets
  • View on Github Wiki
Powered by GitBook
On this page
  • 1.1 Do
  • 1.2 Don’t

Was this helpful?

01. Common Naming Patterns

Naming is crucial for readable and maintainable code. Try to be consistent in the naming style throughout your code.

1.1 Do

  • IsX: Often used for naming logic variables to ask a question (for example, IsEmpty).

  • OnX: An overloadable function called by the framework.

  • SubscribeX: Subscribe to framework event named X, often passing an OnX function to it.

  • MakeC: Make an instance of class c without overloading the c constructor.

  • CreateC: Create an instance of class c, beginning its logical lifetime.

  • DestroyC: End the logic lifetime.

  • C:c: If you’re working with a single instance of class c, it’s fine to call it C.


1.2 Don’t

  • Decorate type names. Just call it thing, not thing_type or thing_class.

  • Decorate enumeration values. Not color := enum{COLOR_Red, COLOR_Green}, use color := enum{Red, Green}.

PreviousImport ExpressionsNext02. Names

Was this helpful?