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
ミニ四駆ベースのAIカー TatamiRacerの製作
covao
1
230
目指せ!本を書いて夢の不労所得 #第3木曜LT会
kaitou
1
110
音に負けない!子どもが騒いでいる脇でも快適オンラインMTGの秘伝
kaitou
0
420
すぐできる! 運送業でやってみた業務効率化3選
dochin2635
0
110
GPT-4oに遅刻理由を考えてもらうボタン #gpt_4o #iotlt #chatgpt
n0bisuke2
0
400
わたしと技術コミュニティとキャリア
kotomin_m
2
1.7k
LLMはTRPGのGMができる(確信)
kgmkm
0
1.2k
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
110
AWS User Community - JAWS-UG/AWS ユーザーコミュニティのご紹介
awsjcpm
1
210
いぬぬウォッチャー - オレトク賞オンライン決勝 #ヒーローズリーグ
n0bisuke2
0
220
エンジニアになって2年間で学んだこと
kaiphoenix
0
180
骨折と入院とIoT #iotlt
n0bisuke2
1
330
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Building Adaptive Systems
keathley
43
2.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
540
Making the Leap to Tech Lead
cromwellryan
134
9.5k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Writing Fast Ruby
sferik
628
62k
Thoughts on Productivity
jonyablonski
69
4.8k
Being A Developer After 40
akosma
90
590k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Java REST API Framework Comparison - PWX 2021
mraible
32
8.8k
Site-Speed That Sticks
csswizardry
10
750
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