Coding conventions and guide lines - martindubenet/wed-dev-design GitHub Wiki

Syntax

18F is an office within the General Services Administration (GSA) that collaborates with other agencies to fix technical problems, build products, and improve how (United States) government serves the public through technology. This office publish a very useful and reliable guidelines for "front end" design and development.

Indentation: Tabs VS Spaces dilemma

I recommended using everything in the above link EXCEPT for the 2 spaces indentation. I prefer setting my indentation preferences to 1 tab character equivalent to 4 spaces but, this is a personal preference that I apply when I'm creating a new project.

It is MANDATORY to follow whatever preference the lead of a project goes for. Otherwise every time you edit and commit a file you will generate pollution in source control logs, applying change on every lines even if you editing only one of then.

Validation tools

  1. W3C markup validation : https://validator.w3.org/
  2. W3C CSS validation : https://jigsaw.w3.org/css-validator/
  3. Web Design Group (WDG) CSS validation : http://www.htmlhelp.com/tools/csscheck/
  4. WCAG accessibility guidelines validation : http://achecker.ca/checker/index.php
  5. Bootstrap markup validation : http://www.bootlint.com/
  6. Wordpress theme validation : https://developer.wordpress.org/themes/advanced-topics/validating-your-theme/

DRY (Don't Repeat Yourself) and DIE (Duplication Is Evil)

Principles:

  1. Repetitions within process highlights the need for automatisation.
  2. Repetitions within logics hilights the need for abstraction (based on semantic analysis).
  3. Repetitions within values highlights the need for structured datas.

Convention references