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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
990
Other Decks in How-to & DIY
See All in How-to & DIY
プログラミング道場 "CoderDojo" を支援するサーバー提供システム 『DojoPaaS』 / How DojoPaaS powers the CoderDojo community in Japan
coderdojojapan
PRO
0
130
「無理」を「コントロール」するスキル / Skills to Control "Muri"
hageyahhoo
5
3.7k
JAWS-UG/AWSコミュニティ アップデート (JAWS-UG函館支部)
awsjcpm
3
120
What's the difference in taste between expensive and cheap mills? Measuring coffee particle size distribution using ImageJ
dogrunjp
0
780
バッドプラクティスから学ぶハワイアン航空で行く re:Invent
kentosuzuki
0
470
いぬぬウォッチャー - オレトク賞オンライン決勝 #ヒーローズリーグ
n0bisuke2
0
290
放っておくと怖い睡眠負債について/fjordbootcamp-251122
yuukago
3
160
JAWS-UGとAWS - JAWS-UG彩の国埼玉設立のお祝い
awsjcpm
2
620
すぐできる! 運送業でやってみた業務効率化3選
dochin2635
0
160
評価のギャップから紐解く、「評価軸」と「ソフトスキル」の重要性
blajir
2
130
Node-REDで制御できるエッジカメラのreCameraを触る #iotlt #JLCPCB #recamera
n0bisuke2
0
150
カンファレンスでリフレッシュ!無理なく楽しむカンファレンス参加術 / How to enjoy conferences without stress
kattsuuya
1
9.5k
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
200
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
720
Designing Experiences People Love
moore
144
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
KATA
mclloyd
PRO
34
15k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
590
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
The SEO Collaboration Effect
kristinabergwall1
0
350
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
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