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
140
Debugging and Profiling Rails App
dpaluy
3
230
Faster on Rails
dpaluy
2
220
How to Prepare 3 min Fundraising Presentation
dpaluy
0
990
Other Decks in How-to & DIY
See All in How-to & DIY
What's the difference in taste between expensive and cheap mills? Measuring coffee particle size distribution using ImageJ
dogrunjp
0
780
【ふりかえりワークショップ】Tryを決めるだけじゃない!感情にフォーカスした、ふりかえりを体験しよう!
scrummasudar
0
1k
家具家電付アパートの自室の冷蔵庫をスマートIoT化してみた!
scbc1167
0
160
エッジで動くNode-REDを作る実験 #noderedjp #noderedcon
n0bisuke2
0
440
2025年03月02日 メイカーズながおかまつり での講演 「コミュニティベースでの製品開発ものづくりフェアの役割」
takasumasakazu
0
310
プログラミング道場 "CoderDojo" を支援するサーバー提供システム 『DojoPaaS』 / How DojoPaaS powers the CoderDojo community in Japan
coderdojojapan
PRO
0
130
20250226_AI Code Agents祭り_MK_AIコーディングエージェントのコラボレーション開発
mk0721
PRO
0
130
カンファレンスでリフレッシュ!無理なく楽しむカンファレンス参加術 / How to enjoy conferences without stress
kattsuuya
1
9.5k
スマートハウスの蓄電性能の効率化を実現してみた~電気自動車編~
runrunsan
0
380
ボードゲーム × 専用収納 〜3Dプリントで埋めるニッチな隙間〜 / Board Games × Custom Storage
handlename
0
180
Nutanix Community Edition 超入門 25.04
ricefield66
0
210
Raspberry Pi Connectを使って #Manus => Node-RED操作チャレンジ #iotlt vol121
n0bisuke2
0
180
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
590
Rails Girls Zürich Keynote
gr2m
96
14k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
A better future with KSS
kneath
240
18k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Navigating Team Friction
lara
192
16k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
55
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
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