Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Coding Style

nikhilm92 edited this page Oct 17, 2011 · 11 revisions

Coding Style

Whenever writing code for this project, please keep the following stylistic guidelines in mind. These are not rules, but are definitely meant to be followed most of the time. Exceptions to this should be very rare.

General

  • Keep it simple. Don't overdo the simple stuff.
  • Avoid bugs.
  • Don't over-sanitize inputs.
  • Don't mess around with libraries.
  • Use common sense.
  • Be consistent.

Formatting

  • Use two-space indents, no tabs.
  • Use Unix-style line endings.
  • Don't introduce trailing whitespace.
  • Add a newline character at the end of a file.

Syntax

  • Never use the then keyword.
  • Never use for.

Naming

Comments

Miscellany

  • Write code for Ruby 1.9. It's the future.

Clone this wiki locally