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
さらなるアウトプットに、Let's ライトニングトーク! ― LTのやり方
ma2shita
2
810
LT(Lightning Talk)のドキドキ感を共有する IoT ぼっとを作った話
scbc1167
1
170
LEGOでRecord Playerを作った話 #LEGOrdPlayer
keicafeblack
0
140
「RubyでLチカ」に挑戦してみた
isaka1022
0
160
LT(Lightning Talk)のドキドキ感を共有しながら 応援してくれるBotを作ってみた!
scbc1167
0
340
M5Stickと超小型エッジAIカメラ「AITRIOS」
hoshinoresearch
0
360
240420MapillaryMeetup2024Tokyo
tosseto
0
200
「おうちクラウド」が今も熱い!
hirosat
2
1k
カフェでノートPCが盗難されたかどうかを検知するIoT #linedc #iotlt #obniz #protoout
n0bisuke2
1
330
OKRで目標立ててみた
kenyamasuko
0
130
【1周年】Blueskyちゃん総集編を通じて青空を遊びつくそう
kawaiirailroads
0
310
DroidKaigi 2024 - 海外就職というキャリアの選択肢
iyotetsuya
1
620
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
51k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Unsuck your backbone
ammeep
669
57k
Designing for Performance
lara
604
68k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
The Language of Interfaces
destraynor
156
24k
Docker and Python
trallard
44
3.3k
Into the Great Unknown - MozCon
thekraken
35
1.6k
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