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
スイングやカードをいい感じに立てるスタンドの話
niccolli
1
420
Burnoutとの「対話」 〜 アジャイルコーチングを活用した、燃え尽き症候群を克服するスキル 〜 / Dialogue with Burnout by Using Agile Coaching Skills
hageyahhoo
0
780
AWS re:Invent 2024 re:Cap – AWS Community Perspective / JAWS-UG新潟
awsjcpm
0
210
AWS re:Invent 2024 re:Cap – AWS Community Perspective
awsjcpm
0
110
JAWS-UG Fukuoka - AWS re:Invent 2024 re:Cap AWS Community Perspective
awsjcpm
2
250
2026年、書籍をちゃんと読むぞ👊 〜約3万円分の書籍を積読にしないためにやること〜
subroh0508
4
800
わたしと仕事とアジャイルコミュニティ / developers summit 2025
matsuoshi
0
1.8k
終わりのない会議を超えて:HolacracyのTactical Meetingを体験しよう!
andrearc
0
200
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
200
登壇資料を素早く作るための順番
kotomin_m
7
1.7k
ボードゲーム × 専用収納 〜3Dプリントで埋めるニッチな隙間〜 / Board Games × Custom Storage
handlename
0
240
「無理」を「コントロール」するスキル / Skills to Control "Muri"
hageyahhoo
6
3.9k
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
240
Navigating Team Friction
lara
192
16k
Producing Creativity
orderedlist
PRO
348
40k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
480
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
150
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
89
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
480
Docker and Python
trallard
47
3.8k
The Language of Interfaces
destraynor
162
26k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
52k
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