Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ruby On Rails coding conventions, standards and...
Search
David Paluy
August 22, 2012
How-to & DIY
1.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby On Rails coding conventions, standards and best practices
David Paluy
August 22, 2012
Transcript
22 slides
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
More Decks by David Paluy
See All by David Paluy
Your LLM Changed. Did it Get Better?
dpaluy
0
11
LLM Telemetry & Evals as First Class Rails Concerns - BlueRidgeRuby 2026
dpaluy
0
84
Tools to help you better understand the code
dpaluy
0
160
Debugging and Profiling Rails App
dpaluy
3
260
Faster on Rails
dpaluy
2
250
How to Prepare 3 min Fundraising Presentation
dpaluy
0
1k
Other Decks in How-to & DIY
See All in How-to & DIY
OSSコミュニティがくれた「人との繋がり」
tanahiro2010
2
490
AWS Community Builders Update - JAWS-UG Tokyo and Sainokuni
awsjcpm
3
360
グローバルチームでなんとかしがみつく英語コミュニケーション
yatsu
0
130
スイングやカードをいい感じに立てるスタンドの話
niccolli
1
550
放っておくと怖い睡眠負債について/fjordbootcamp-251122
yuukago
3
420
移動は善 / 20260124-NGK2026S
girigiribauer
1
250
OpenClawハンズオンでのトラブルとデバイス向けなんちゃらクロー #IoTLT vol133
n0bisuke2
1
330
JAWS-UG/AWS Community Update 2026/05/25 JAWS-UG札幌 & 秋田コラボ会
awsjcpm
0
200
JAWS-UG 山梨 第10回 勉強会 Community Update
awsjcpm
0
1.2k
RustでもVJしたい!
taiseiue
0
120
JAWS-UG/AWS Community Update
awsjcpm
0
350
決まらない会議を卒業しよう 意思決定を進化させるワークショップ
andrearc
0
300
Featured
See All Featured
Between Models and Reality
mayunak
4
570
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
How to make the Groovebox
asonas
2
2.6k
New Earth Scene 8
popppiees
5
2.8k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
330
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.2k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530