1. Home
  2. Docs
  3. Simpods MVC
  4. Getting Started
  5. Coding Conventions

Coding Conventions

We try to follow the WordPress Coding Standards as closely as possible. Below are some of the conventions we stick to very closely:

  • Use underscores rather than camel case for all variables and function names

  • Use real tabs to indent, not spaces

  • No shorthand PHP, we try to make our code as easy to read as possible

  • Use useful variable names

Naming Conventions

Alongside these standards, we also append the expected type to variables and functions.

  • _fn is a function
  • _int is an integer

  • _num is a number other than integer

  • _str is a string

  • _url is a URL

  • _arr is an array

  • _obj is an object

  • _bln is a boolean

  • _cla is a class

For example:

  • $google_url = 'www.google.com';

  • $stuff_arr = make_stuff_fn();

  • $is_long_bln = true;

  • $meaning_of_life_int = 42;

We also aim to give all of our files useful names. For example:

  • Templates for pages are prepended with template-

  • Singles are prepended with single-

  • Classes are appended with .class