Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby On Rails coding conventions, standards and...
Search
David Paluy
August 22, 2012
How-to & DIY
1
1.4k
Ruby On Rails coding conventions, standards and best practices
David Paluy
August 22, 2012
Tweet
Share
More Decks by David Paluy
See All by David Paluy
Tools to help you better understand the code
dpaluy
0
130
Debugging and Profiling Rails App
dpaluy
3
220
Faster on Rails
dpaluy
2
200
How to Prepare 3 min Fundraising Presentation
dpaluy
0
980
Other Decks in How-to & DIY
See All in How-to & DIY
骨折と入院とIoT #iotlt
n0bisuke2
1
350
安全に失敗するための手遊び-未定義動作を引き出そう-
zilmina
0
650
Within the team, I grow as a tester and continuously pursue product quality
camel_404
6
2.6k
JAWS-UG会津 & JP Stripes会津 合同勉強会 JAWS-UGとAWSコミュニティプログラムアップデート
awsjcpm
0
120
파이썬 토룡신점 운영후기
lqez
0
460
ミニ四駆ベースのAIカー TatamiRacerの製作
covao
1
270
【技術カンファレンス運営の裏側】Iwaken Lab 技術好き学生の近況報告 & ことみんさんに技術カンファレンス運営の裏側を聞いちゃう会
kotomin_m
5
1.7k
The Definitive? Guide To Locally Organizing RubyKaigi
sylph01
6
1.6k
ジャンカーよ、車も買え ~10分でわかる!? 中古車選び入門~
arkw
1
140
How to make the Groovebox
asonas
2
1.6k
M5Stackを使ってSズキの魔改造モンスターマシンを作ってみた
syumme01
0
210
How to get hundreds of organic backlinks through statistics link building
ronishehu
1
290
Featured
See All Featured
A better future with KSS
kneath
239
17k
Facilitating Awesome Meetings
lara
55
6.5k
Why Our Code Smells
bkeepers
PRO
339
57k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
Building Adaptive Systems
keathley
43
2.7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
Code Review Best Practice
trishagee
70
19k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Docker and Python
trallard
45
3.6k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
13k
A Tale of Four Properties
chriscoyier
160
23k
Transcript
Ruby On Rails coding conventions, standards and best practices David
Paluy August 2012
Philosophy (from Rails) • DRY – Don't Repeat Yourself •
Convention over Configuration • YAGNI - You ain't gonna need it
Source code Style • Two spaces, no tabs • Boolean
tests: don't use “and” and “or”, always use “&&” and “| |”
Go Easy on the Comments • If it's obvious –
don't explain it • Remove old commented code • “How to” comments
Camels for Classes, Snakes Everywhere Else • “Snake case”: lowercasse_words_separated_by_underscore
• “Camel case”: ClassName good Class_name bad • Constants: (my own preference) ALL_UPPERCASE = true
Parentheses (Optional)
Parentheses (Do & Don't)
Folding Up Lines
Folding Up Blocks
if vs unless
while vs until
Use Modifier Forms
each, NOT for
In the Wild
Use Symbols to Stand for Something
Composing Methods for Humans
Make the code a little more articulate
Readable Code
Readable code makes your classes easier to test
Git the diff says what you did; your commit message
should tell me why you did this
Summary Good code is like a good joke: It needs
no explanation
Credentials