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.5k
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
990
Other Decks in How-to & DIY
See All in How-to & DIY
自分がご機嫌になれる 素敵な場所を守るために
kenichirokimura
3
710
Maker Mela Mumbai 2025 資料 2024/12/12取得
takasumasakazu
0
140
The Definitive? Guide To Locally Organizing RubyKaigi
sylph01
9
2.6k
Trying "Vibe No-code/Low-code" with MCP #noderedjp
n0bisuke2
0
130
人はなぜコミュニティとつながると幸せを感じるのか
448jp
3
390
ROSAというLLM使ったROSエージェントをおもちゃに実装してみた話
takeofuture
0
110
評価のギャップから紐解く、「評価軸」と「ソフトスキル」の重要性
blajir
2
140
AWSコミュニティプログラムのご紹介 -グローバル展開するコミュニティプログラム-
awsjcpm
0
290
スイングやカードをいい感じに立てるスタンドの話
niccolli
1
420
ライブ感を生む 巻き込み型スライドの作り方/Create your slide like a heavy metal concert
ikuodanaka
5
1.3k
スマートハウスの蓄電性能の効率化を実現してみた~電気自動車編~
runrunsan
0
410
EmbeddingGemmaをDifyから使いたいけどAPI経由はつまらん #iotlt #gemma #dify
n0bisuke2
0
160
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
55
8k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
340
Darren the Foodie - Storyboard
khoart
PRO
3
2.7k
4 Signs Your Business is Dying
shpigford
187
22k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
360
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
220
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
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