$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
140
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
バッドプラクティスから学ぶハワイアン航空で行く re:Invent
kentosuzuki
0
440
2025年03月02日 メイカーズながおかまつり での講演 「コミュニティベースでの製品開発ものづくりフェアの役割」
takasumasakazu
0
280
Nutanix Community Edition 超入門 25.04
ricefield66
0
200
「AITRIOS」でトカゲの活動量を可視化
hoshinoresearch
0
430
M5Stickと超小型エッジAIカメラ「AITRIOS」
hoshinoresearch
0
560
JAWS-UG/AWSコミュニティ JAWS-UG おおいた
awsjcpm
2
2.9k
AWSコミュニティプログラムとJAWS-UGアップデート / JAWS-UG函館 勉強会 vol.14
awsjcpm
2
170
2025版 鯖落ちパーツで安価に機械学習用マシンを作ってみる
bobfromjapan
0
440
JAWS-UGについて JAWS-UG TOHOKU [青森] 弘前開催
awsjcpm
0
280
評価のギャップから紐解く、「評価軸」と「ソフトスキル」の重要性
blajir
2
120
[電子工作]クリップモーターをつくろう
oriontakemura
1
480
AWS re:Invent 2024 re:Cap – AWS Community Perspective / JAWS-UG新潟
awsjcpm
0
180
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Six Lessons from altMBA
skipperchong
29
4.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
4 Signs Your Business is Dying
shpigford
186
22k
Documentation Writing (for coders)
carmenintech
76
5.2k
Statistics for Hackers
jakevdp
799
230k
Designing for humans not robots
tammielis
254
26k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
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