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
JAWS-UG Fukuoka - AWS re:Invent 2024 re:Cap AWS Community Perspective
awsjcpm
2
170
Raspberry Pi Connectを使って #Manus => Node-RED操作チャレンジ #iotlt vol121
n0bisuke2
0
140
ミニ四駆ベースのAIカー TatamiRacerの製作
covao
1
250
苦いビールを避ける冴えたやり方
watany
2
430
#スタックチャン「魔改造の夜」に行く
syumme01
1
290
AWSと学生支援 - Education-JAWS #0
awsjcpm
1
170
「無理」を「コントロール」するスキル / Skills to Control "Muri"
hageyahhoo
6
2.8k
わたしと技術コミュニティとキャリア
kotomin_m
2
1.7k
PlatformIO IDE用M5Stack定型コード環境の紹介
3110
1
570
HCIのデモに役立つ映像活用アイデア集 #WISS2024 ナイトセッション #HCIVideoCulture
bonsaistudiojp
2
950
AIお菓子ロッカー
keicafeblack
0
160
わたしと仕事とアジャイルコミュニティ / developers summit 2025
matsuoshi
0
1.1k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Fireside Chat
paigeccino
39
3.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Music & Morning Musume
bryan
46
6.7k
4 Signs Your Business is Dying
shpigford
184
22k
GitHub's CSS Performance
jonrohan
1031
460k
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