Conventions and preferences to be shared within teams to promote harmonious and joyful Ruby on Rails development.
- norman nielsen’s 10 usability heuristics for user interface design
- shneiderman’s eight golden rules of interface design
- please add enough logging to give your application a voice, use the right Log Severity Level
- tame crazy rails logging and also make it ready for log mining - use Lograge
- how to write great commit messages https://chris.beams.io/posts/git-commit/#imperative
- setup source control
- setup git hooks
- setup ci
- setup boxen
- read betterspecs.org
- use latest rspec conventions:
expect(expectation).to eq()
- write tests that check for negative scenarios before happy paths
- use only one describe block per spec file
- for contexts in model specs, use the name
context ".method_name"
- for contexts in controller specs, use the name
context "http_verb /resource.:format"
- sound direct, confident and explicit - f.ex. instead
it "should return blah"
, writeit "returns blah"
- all magic strings in translations yml
- javascript has to be camel-case
- this captures it pretty well - https://github.com/alphagov/styleguides/blob/master/git.md
- use uuids instead of ids
- use .iso8601 timestamps
- process asynchronously all requests that can take longer than 2s, or are making another http request in the background
- don’t use quotes within strings - use
%q()
or%Q()
instead - use
if !(expr)
instead ofunless (expr)
, i know many people who suffer from unlessexia - prefer guard statements over if else, wherever possible
- prefer case statements over conditionals built around value stored in a variable
- pagination: kaminari
- authentication: devise
- asynchronous processing: sidekiq
- orm: mongoid
- task scheduler: whenever
- database server: postgres
- document store: mongo
- search engine: elastic search
- ci-server: jenkins
- monitoring: nagios
- key-value-store: redis
- ui framework: twitter bootstrap
- ruby server: puma
- we all are interruptable
- if you're new to the team, and no one has yet told you what you're supposed to work on, firstly - 'relax !', then do anything you want related to the project. someone will come and speak to you about what is expected from you.
- very often, you might be in a situation where you might want to work on something else that's going on which seems more interesting. no issues. make sure you sign-up accordingly in the next stand-up, try to pair on that story, or if you can't get it working your way, let your friendly tech-lead or PM know about it. we'll try and do something about it.