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.4k
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
130
Debugging and Profiling Rails App
dpaluy
3
220
Faster on Rails
dpaluy
2
200
How to Prepare 3 min Fundraising Presentation
dpaluy
0
980
Other Decks in How-to & DIY
See All in How-to & DIY
Why did my proposals get rejected?
okuramasafumi
1
710
M5Stackで自宅オンラインクレーンゲームを作ってみた
hikabe
0
100
2025年03月02日 メイカーズながおかまつり での講演 「コミュニティベースでの製品開発ものづくりフェアの役割」
takasumasakazu
0
250
JAWS-UG Community Upadate - JAWS-UG 熊本
awsjcpm
2
160
ブロックテーマをゴリゴリに使い倒してサイトを作った話 / Kansai WordPress Meetup 2025 01 25
tbshiki
1
620
JAWS-UGから学んだコミュニティの成功要因 (Success Factors)
awsjcpm
5
510
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
140
あなたは何故コミュニティに参加するのか?
awsjcpm
1
180
【技術カンファレンス運営の裏側】Iwaken Lab 技術好き学生の近況報告 & ことみんさんに技術カンファレンス運営の裏側を聞いちゃう会
kotomin_m
5
1.7k
JAWS-UG会津 & JP Stripes会津 合同勉強会 JAWS-UGとAWSコミュニティプログラムアップデート
awsjcpm
0
120
ラズパイカメラ向け ケーブル延長基板・ハウジングの開発
koheimasaki
PRO
2
330
人はなぜコミュニティとつながると幸せを感じるのか
448jp
3
310
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
55
13k
Bash Introduction
62gerente
614
210k
KATA
mclloyd
32
14k
Faster Mobile Websites
deanohume
309
31k
Building Adaptive Systems
keathley
43
2.7k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
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