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.5k
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
AWS re:Invent 2024 re:Cap – AWS Community Perspective / JAWS-UG新潟
awsjcpm
0
210
How to make the Groovebox
asonas
2
2k
スマートハウスの蓄電性能の効率化を実現してみた~電気自動車編~
runrunsan
0
430
放っておくと怖い睡眠負債について/fjordbootcamp-251122
yuukago
3
220
ROSAというLLM使ったROSエージェントをおもちゃに実装してみた話
takeofuture
0
120
Within the team, I grow as a tester and continuously pursue product quality
camel_404
6
3.1k
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
200
5年間ぐらい、 スプリントレトロスペクティブは、 「+/Δ」しかしてないので、 あらためて良いのか悪いか考えてみる / Doing Plus Delta for about five years
camel_404
1
340
私がカンファレンスのプロポーザルを書くときに考えていること
kotomin_m
1
670
EmbeddingGemmaをDifyから使いたいけどAPI経由はつまらん #iotlt #gemma #dify
n0bisuke2
0
160
JAWS-UG/AWSコミュニティプログラムのご紹介 - JAWS-UG 佐賀
awsjcpm
2
220
10分de名コミュ “最高の自分”を演じ憧れの同業者と渡り合う
subroh0508
1
630
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Test your architecture with Archunit
thirion
1
2.2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
The World Runs on Bad Software
bkeepers
PRO
72
12k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
Discover your Explorer Soul
emna__ayadi
2
1.1k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
Optimizing for Happiness
mojombo
378
71k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
290
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.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