Code style and standards guides

Coding standards are a set of guidelines, best practices, programming styles and conventions that developers follow when writing source code for a project. Developers should follow these standards in order to, among other things:

  • keep code maintainable
  • keep code transparent, sane, and readable
  • keep code scalable.

Where a project is governed by a style guide, this should be learned, understood, and implemented at all times; any deviation must be fully justified.

While consistency is important, equally important is knowing when to be inconsistent—sometimes the style guide just doesn’t apply.

The ground rule is simple: readability is preferential to strict adherence to rules.

Guides available

Style and standards guides are available for:

  • Cascading Style Sheets (CSS), including pre-processors such as Sass
  • HTML
  • JavaScript, including frameworks such as jQuery
  • PHP
  • XML, including RSS and XSLT
  • Commit messages (for version control software such as Git)
  • Markdown (for writing documentation)
  • Sublime Text packages (standard packages for developing the DPL).

Digital code style and standards guides