This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

Style Guides

Summary

Also known as Programming Styles and Coding Conventions, style guides are sets of rules used by developers to ensure consistent formatting and organization of their code.

Purpose

A style guide or style manual is a set of standards for the writing and design of code. The implementation of a style guide provides uniformity in code style and formatting, often covering guidelines regarding indentation (tabs vs. spaces), variable and function naming conventions, where best to apply whitespace and so on.[1]

Style guides ensure consistent formatting and organization of their code. Some Style Guides may also include a Naming Convention which is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types and functions etc. in source code and documentation.[2]

Naming Conventions[2]

  • UpperCamelCase : with the first letter of every word capitalized
  • lowerCamelCase : with the first letter lowercase and the first letters of subsequent words in uppercase
  • UPPERCASE : with all letters in uppercase, separated by an underscore (_) or a dash (-)
  • lowercase : with all letters in lowercase, separated by an underscore (_) or a dash (-)
  • Hungarian Notation : with type prefix, see http://en.wikipedia.org/wiki/Hungarian_notation

Common Style Guides

JavaScript[1]

Html/Css[3]

  1. 1.01.1 JavaScript Style Guides And Beautifiers, by Addy Osmani.
  2. 2.02.1 Naming Convention, on Wikipedia.
  3. Css Style Guides, by Chris Coyer.