Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
210
How to Prepare 3 min Fundraising Presentation
dpaluy
0
980
Other Decks in How-to & DIY
See All in How-to & DIY
ModuleLLM、最前線!
anoken
1
270
JAWS-UG会津 & JP Stripes会津 合同勉強会 JAWS-UGとAWSコミュニティプログラムアップデート
awsjcpm
0
160
活動振り返りと生成AIによるコード生成の試み
covao
0
120
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
160
2025年03月02日 メイカーズながおかまつり での講演 「コミュニティベースでの製品開発ものづくりフェアの役割」
takasumasakazu
0
280
AWSコミュニティプログラムとJAWS-UGアップデート / JAWS-UG函館 勉強会 vol.14
awsjcpm
2
170
ATOMS3R-CAMとClaude SKILLSでタイムラプスチャレンジ #iotlt
n0bisuke2
0
170
How to create better speaker proposals
logico_jp
2
1.1k
なぜJAWS-UGはこんなにも活発なのか?
awsjcpm
1
160
Node-REDで制御できるエッジカメラのreCameraを触る #iotlt #JLCPCB #recamera
n0bisuke2
0
130
M5Stackを使ってSズキの魔改造モンスターマシンを作ってみた
syumme01
0
240
Goカードゲームを 作ってみた!
senoue
0
160
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Language of Interfaces
destraynor
162
25k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
11
960
Typedesign – Prime Four
hannesfritz
42
2.9k
Writing Fast Ruby
sferik
630
62k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
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