Reality66 Naming Conventions

Reality66 LLC Here are the coding standards we use at Reality66. The purpose of these naming conventions and standards is to provide an easy to remember set of rules so all Reality66 developers write consistent code without having to constantly reference coding standards documentation. The primary intent is to have a small, easily memorized set of rules for each coding context.


Definitions for consistent coding practices

  • PascalCase: All words start with capital letters
  • camelCase: All words start with capital letters except the first word
  • snake_case: All words are lowercase separated by underscores
  • ALL_CAPITALS: All letters are capital and all words are separated by underscores

Possibly Confusing Words

The following phrases are two words:

  • zip code
  • first name

The following words are one word:

  • filename
  • pathname
  • classname
  • namespace

NOTE: It’s worth emphasizing that a word is a word no matter how small. It is tempting
to write things like myid, and firstname instead of my_id, and first_name but don’t do it.

Abbreviations

When naming functions, variables, classes, etc. please use concise and descriptive names.
There are three allowed abbreviations, id, max, and min.
Please write the complete words for everything else including quantity, capital, and any
other word you might feel compelled to abbreviate.

Always Use Underscores

Everything should be snake_case. This includes variable names, function names, file names, and everything in all languages at all times with the following exceptions:

  • All class names are PascalCase
  • PHP files that define classes are named in PascalCase
  • Constants are ALL_CAPITALS

Leave a Reply

Your email address will not be published.