$30 off During Our Annual Pro Sale. View Details »
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
230
Faster on Rails
dpaluy
2
220
How to Prepare 3 min Fundraising Presentation
dpaluy
0
980
Other Decks in How-to & DIY
See All in How-to & DIY
個人制作コンテンツの多言語展開のノウハウを全公開! 〜世界に自分を発信しよう!〜
syotasasaki593876
0
120
How to make the Groovebox
asonas
2
1.8k
CH32Vシリーズを楽しもう(74thの場合) / enjoy ch32v series
74th
1
1.3k
餃子コミュニティの活性化/TechGYOZA
nishiuma
2
120
未来大生の胃を支える函館グルメ
deflis
0
570
安全に失敗するための手遊び-未定義動作を引き出そう-
zilmina
0
700
人を補助するAI ~AIとの壁打ちがきっかけになる~ #共創AIミートアップ
ishikiemo
0
500
SoracomUG-Ishikawa-1.pdf
yukima77
0
120
Raspberry Pi Connectを使って #Manus => Node-RED操作チャレンジ #iotlt vol121
n0bisuke2
0
170
Within the team, I grow as a tester and continuously pursue product quality
camel_404
6
2.8k
カンファレンスでリフレッシュ!無理なく楽しむカンファレンス参加術 / How to enjoy conferences without stress
kattsuuya
1
9.2k
エンジニアになって2年間で学んだこと
kaiphoenix
0
230
Featured
See All Featured
Docker and Python
trallard
47
3.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Making Projects Easy
brettharned
120
6.5k
The Cult of Friendly URLs
andyhume
79
6.7k
GraphQLとの向き合い方2022年版
quramy
50
14k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Practical Orchestrator
shlominoach
190
11k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Language of Interfaces
destraynor
162
25k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
The Invisible Side of Design
smashingmag
302
51k
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