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
210
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
銀座線・半蔵門線から、ふりかえりカンファレンス2024現地会場への行き方
pokotyamu
0
250
What I Talk About When I Talk About Social Media
idealhack
0
130
enebularを活用したNode-REDによるIoTシステム開発と運用
taokiuhuru
0
470
#スタックチャン「魔改造の夜」に行く
syumme01
1
180
新婚19年目から学ぶ夫婦円満の正しい歩き方 / Life is beautiful
soudai
11
4.2k
【バスケ】ボックススコアを用いたオールインワンメトリクス作成手続き
rnsr0371
0
450
工作教室 ロボットハンドを作ろう
keicafeblack
0
140
APCのAWS認定マスターたちに聞いてみた
masuchoku
0
120
苦いビールを避ける冴えたやり方
watany
2
170
AWS Community Day 2024: Using AWS to build a launchable knowledge rocket 👉 Organize knowledge, accelerate learning and understand AI in the process
dwchiang
0
150
Terra Charge|EVコンセントご利用ガイドブック / Terra Charge EV Charger Guidebook
contents
0
1.2k
データエンジニアのためのテクニカルサポートとLLM
yutomatsunoo
0
1.1k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
3k
Statistics for Hackers
jakevdp
797
220k
Visualization
eitanlees
146
15k
For a Future-Friendly Web
brad_frost
176
9.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Designing Experiences People Love
moore
139
23k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Facilitating Awesome Meetings
lara
50
6.2k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
GraphQLとの向き合い方2022年版
quramy
44
13k
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