Pages

L

Litanies
of Programming Style
In the Catholic Church, six litanies
are approved for public recitation.

— Wikipedia, Litany#Roman_Catholic_litanies


Litanies of

  1. General Principles
  2. Formatting Convensions
  3. Naming Convensions
  4. Documentation Convensions
  5. Programming Convensions
  6. Packaging Convensions

A. General Principles

  1. When in Rome, do as the Romans do. Write code that blends in with code around it.
  2. Be consistent. For example, if you use tab characters to indent code, always use tab characters to indent code. That said, don’t use tabs to indent code, use spaces instead. But if you decide to use tabs anyway, at least use them consistently.
  3. Be predictable. Adhere to the principle of least astonishment.
  4. Code like you’re trying to score low in golf: strive for few code changes and efficient algorithms without incurring penalties for undo delay; measure twice and cut once, while remembering that time is money.
  5. Embrace the KISS principle. Favor simplicity and clarity over cleverness.
  6. Seek first to understand Chesterton’s fence before altering it.


https://xkcd.com/1285/

B. Formatting Convensions