$30 off During Our Annual Pro Sale. View Details »
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
230
Faster on Rails
dpaluy
2
220
How to Prepare 3 min Fundraising Presentation
dpaluy
0
980
Other Decks in How-to & DIY
See All in How-to & DIY
苦手の克服方法 / How to overcome weaknesses
toma_sm
0
310
251011「ひとりより、みんなで!」 九州の支部で始めた、新しい連携のかたち
east_takumi
2
110
Goカードゲームを 作ってみた!
senoue
0
160
人はなぜコミュニティとつながると幸せを感じるのか
448jp
3
340
「AITRIOS」でトカゲの活動量を可視化
hoshinoresearch
0
430
個人制作コンテンツの多言語展開のノウハウを全公開! 〜世界に自分を発信しよう!〜
syotasasaki593876
0
120
「無理」を「コントロール」するスキル / Skills to Control "Muri"
hageyahhoo
5
3.5k
Trying "Vibe No-code/Low-code" with MCP #noderedjp
n0bisuke2
0
110
未来大生の胃を支える函館グルメ
deflis
0
570
ラズパイカメラ向け ケーブル延長基板・ハウジングの開発
koheimasaki
PRO
2
400
評価のギャップから紐解く、「評価軸」と「ソフトスキル」の重要性
blajir
2
120
いぬぬウォッチャー - オレトク賞オンライン決勝 #ヒーローズリーグ
n0bisuke2
0
270
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.2k
Navigating Team Friction
lara
191
16k
[SF Ruby Conf 2025] Rails X
palkan
0
510
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Documentation Writing (for coders)
carmenintech
76
5.2k
Speed Design
sergeychernyshev
33
1.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Done Done
chrislema
186
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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