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
140
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
「変えること」「変わること」を楽しむ力で"敵わない存在"と向き合う
subroh0508
1
420
安全に失敗するための手遊び-未定義動作を引き出そう-
zilmina
0
710
新婚19年目から学ぶ夫婦円満の正しい歩き方 / Life is beautiful
soudai
PRO
12
4.9k
人を補助するAI ~AIとの壁打ちがきっかけになる~ #共創AIミートアップ
ishikiemo
0
520
5年間ぐらい、 スプリントレトロスペクティブは、 「+/Δ」しかしてないので、 あらためて良いのか悪いか考えてみる / Doing Plus Delta for about five years
camel_404
1
290
파이썬 토룡신점 운영후기
lqez
0
500
AWSと学生支援 - Education-JAWS #0
awsjcpm
1
210
エッジで動くNode-REDを作る実験 #noderedjp #noderedcon
n0bisuke2
0
400
ブロックテーマをゴリゴリに使い倒してサイトを作った話 / Kansai WordPress Meetup 2025 01 25
tbshiki
1
1.2k
アイデアをカタチにする、イマジニア
haruka_imgr
0
170
JAWS-UG KOBE #1 - JAWS-UG Updates
awsjcpm
0
130
雑にコミュニティを続けてもいいと思っている/Feel free to continue the community
camel_404
0
320
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
88
What's in a price? How to price your products and services
michaelherold
246
13k
Automating Front-end Workflow
addyosmani
1371
200k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
51k
AI: The stuff that nobody shows you
jnunemaker
PRO
1
37
Navigating Team Friction
lara
191
16k
[SF Ruby Conf 2025] Rails X
palkan
0
660
Odyssey Design
rkendrick25
PRO
0
450
How STYLIGHT went responsive
nonsquared
100
6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
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