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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
More Decks by David Paluy
See All by David Paluy
LLM Telemetry & Evals as First Class Rails Concerns - BlueRidgeRuby 2026
dpaluy
0
41
Tools to help you better understand the code
dpaluy
0
150
Debugging and Profiling Rails App
dpaluy
3
240
Faster on Rails
dpaluy
2
230
How to Prepare 3 min Fundraising Presentation
dpaluy
0
1k
Other Decks in How-to & DIY
See All in How-to & DIY
私がカンファレンスのプロポーザルを書くときに考えていること
kotomin_m
1
760
JAWS-UG横浜100回記念 私のAWS ジャーニーと日本からみた横浜支部
awsjcpm
0
420
地方カンファレンスのスタッフしてて思うこと
yumechi
0
230
[電子工作]クリップモーターをつくろう
oriontakemura
1
810
エッジで動くNode-REDを作る実験 #noderedjp #noderedcon
n0bisuke2
0
590
人見知りな HUB おじさんが 会話のハードルを超え、 今度は誰かの踏み台になろうとする話/hub-guy-as-a-stepping-stone
aokiplayer
2
230
EXPO 2025 大屋根リングをぐるっと周回! 【GPSマルチユニット×ソラカメ実験】
scbc1167
0
130
画面の向こうから「気づき」を得る 画面の向こうを「物差し」として捉える
subroh0508
1
350
JAWS-UG/AWS Community Update
awsjcpm
0
290
おっきなガジェットの回線事情
2bo
1
220
移動は善 / 20260124-NGK2026S
girigiribauer
1
180
AWSコミュニティプログラムのご紹介 -グローバル展開するコミュニティプログラム-
awsjcpm
0
360
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2.1k
How GitHub (no longer) Works
holman
316
150k
Building Adaptive Systems
keathley
44
3.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Visualization
eitanlees
152
17k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
860
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
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