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
HCIのデモに役立つ映像活用アイデア集 #WISS2024 ナイトセッション #HCIVideoCulture
bonsaistudiojp
2
990
AIお菓子ロッカー
keicafeblack
0
190
家具家電付アパートの自室の冷蔵庫をスマートIoT化してみた!
scbc1167
0
130
Azure PortalのQoLを上げてたら Big Techに怒られた
horihiro
2
400
苦いビールを避ける冴えたやり方
watany
2
440
目指せ!本を書いて夢の不労所得 #第3木曜LT会
kaitou
1
130
AWS Community Day 2024: Using AWS to build a launchable knowledge rocket 👉 Organize knowledge, accelerate learning and understand AI in the process
dwchiang
0
230
JAWS-UG/AWSコミュニティプログラムのご紹介 - JAWS-UG 佐賀
awsjcpm
2
170
ジャンカーよ、車も買え ~10分でわかる!? 中古車選び入門~
arkw
1
150
PlatformIO IDE用M5Stack定型コード環境の紹介
3110
1
600
エンジニアになって2年間で学んだこと
kaiphoenix
0
210
AWS User Community - JAWS-UG/AWS ユーザーコミュニティのご紹介
awsjcpm
1
230
Featured
See All Featured
KATA
mclloyd
32
15k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Become a Pro
speakerdeck
PRO
29
5.5k
The Cost Of JavaScript in 2023
addyosmani
54
9k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Fireside Chat
paigeccino
40
3.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
30
2.7k
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