Fork at claudiob/style on GitHub

Coding guidelines

What holds in any language. What holds in Ruby. What holds in Rails.

Encrypt personal data

Don’t store your customers’ phone, email, last name, street in plain text.

Code optimistically

Never write a method nobody calls. Never rescue an error nobody has incurred.

Unchained melody

Two calls on the same object in one expression are the tell: the second is unneeded.

Say it short

Between two versions carrying the same meaning, always pick the shorter name.

No sleights of hand

claimed_by, matching — methods named like a query must not have any side effect.

Shy away from public

Every method that can be private must be private.

Document what’s public

Add a single-line comment above each class/constant/method that is not private.

Communicate through git

Small commits with long descriptions (why the code was shipped) and linear history.

Sharpen your tests

Full coverage and not one line more. Never test code you don’t own.

Write good English

Don’t Titleize. It’s ZIP not Zip. It’s license not licence. Respect the apostrophes.