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.5k
1
Share
Ruby On Rails coding conventions, standards and best practices
David Paluy
August 22, 2012
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
230
How to Prepare 3 min Fundraising Presentation
dpaluy
0
990
Other Decks in How-to & DIY
See All in How-to & DIY
苦手の克服方法 / How to overcome weaknesses
toma_sm
0
360
What's the difference in taste between expensive and cheap mills? Measuring coffee particle size distribution using ImageJ
dogrunjp
0
810
人はなぜコミュニティとつながると幸せを感じるのか
448jp
3
400
【加筆修正版】ハードワークを支えるフィジカルとメンタルを構築る#rubymusclemixin 活動 #きのこ2025 #きのこ2025_b
bash0c7
0
340
終わりのない会議を超えて:HolacracyのTactical Meetingを体験しよう!
andrearc
0
210
地方カンファレンスのスタッフしてて思うこと
yumechi
0
200
20250226_AI Code Agents祭り_MK_AIコーディングエージェントのコラボレーション開発
mk0721
PRO
0
150
ボードゲーム × 専用収納 〜3Dプリントで埋めるニッチな隙間〜 / Board Games × Custom Storage
handlename
0
250
Node-REDで制御できるエッジカメラのreCameraを触る #iotlt #JLCPCB #recamera
n0bisuke2
0
170
JAWS-UG Community Upadate - JAWS-UG 熊本
awsjcpm
2
230
LLMはTRPGのGMができる(確信)
kgmkm
0
2.5k
大学内にファブスペースをつくってみた #sapporo3dp / Making HIU Fab
yumulab
1
150
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
280
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Prompt Engineering for Job Search
mfonobong
0
250
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
250
We Are The Robots
honzajavorek
0
210
Paper Plane (Part 1)
katiecoart
PRO
0
6.4k
The Invisible Side of Design
smashingmag
302
51k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Between Models and Reality
mayunak
3
260
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
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