Code style guides for various programming languages and technologies
- All languages
- Ruby
- Python
- PERL
- Haskell
- c++
- Erlang
- JavaScript
- CoffeeScript
- All-DataStores
- rdbs
- MySQL
- docdbs
- mongo
- couch
- keystores
- redis
- All network topologies
- Cloud
- Readability
- Consistency
- DRY
- ReUse
- Flat -vs- Nested
- Beauty and Zen
- Simplicity
- Use ASCII (or UTF-8, not optimal)
- Use 2 space indent, no tabs
- Use Unix-style line endings
- Use spaces around operators, after commas, colons, and semicolons, around { and before }
- No spaces after (, [ and before ], )
- Use two spaces before statement modifiers (postfix if/unless/while/until/resque)
- Indent when as deep as case
- Use an empty line before the return value of a method (unless it only has one line), and an empty line between defs
- Use RDoc and its conventions for API documentation. Don't put an empty line between the comment black and the def.
- Use empty lines to break up a long method into logical paragraphs
- Keep lines fewer than 80 characters
- Avoid trailing whitespace
- Comment that are longer than one word should be capitalized and written using English rules
- Avoid superluous comments
- Write well, thoughtout comments intended for public consumption