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
120
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
わたしと技術コミュニティとキャリア
kotomin_m
2
1.3k
[너구리랑! 회고 밋업 2023] 비전공자 PM의 우당탕탕 2023년 // 의현 님
develop_neoguri
0
130
田中 is a new HelloWorld
akichika
1
290
LT(Lightning Talk)のドキドキ感を共有する IoT ぼっとキーホルダ!
scbc1167
0
300
銀座線・半蔵門線から、ふりかえりカンファレンス2024現地会場への行き方
pokotyamu
0
260
miiboとamiibo繋げてみた。 #miibo #amiibo #iotlt
n0bisuke2
1
310
How to create better speaker proposals
logico_jp
2
660
JAWS-UGについて JAWS-UG TOHOKU [青森] 弘前開催
awsjcpm
0
120
JAWS-UGのご紹介 JAWS-UGとは?
awsjcpm
0
210
エンジニアになって2年間で学んだこと
kaiphoenix
0
110
骨折と入院とIoT #iotlt
n0bisuke2
1
260
Snowflake WEST ユーザー会第2回「ハンズオンセッション」
mabokaneko0802
0
250
Featured
See All Featured
Site-Speed That Sticks
csswizardry
4
380
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
For a Future-Friendly Web
brad_frost
176
9.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
960
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