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.5k
1
Share
Ruby On Rails coding conventions, standards and best practices
David Paluy
August 22, 2012
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
230
How to Prepare 3 min Fundraising Presentation
dpaluy
0
990
Other Decks in How-to & DIY
See All in How-to & DIY
JAWS/AWS Community Updates - JAWS-UG新潟 #29
awsjcpm
1
110
なぜJAWS-UGはこんなにも活発なのか?
awsjcpm
1
220
JAWS-UG 山梨 第10回 勉強会 Community Update
awsjcpm
0
1k
ブロックテーマをゴリゴリに使い倒してサイトを作った話 / Kansai WordPress Meetup 2025 01 25
tbshiki
1
1.7k
スイングやカードをいい感じに立てるスタンドの話
niccolli
1
440
EjecTea 2026 / 20260228-osc26tk-ejectea
akkiesoft
0
840
JAWS-UG初心者支部 JAWS-UG Updates
awsjcpm
4
120
AWSコミュニティプログラムのご紹介 -グローバル展開するコミュニティプログラム-
awsjcpm
0
310
おっきなガジェットの回線事情
2bo
1
200
LLMはTRPGのGMができる(確信)
kgmkm
0
2.5k
Node-REDでセンサーなどから起動させるカメラノードを作ったよ IoTLT vol123 #iotlt
n0bisuke2
0
140
5年間ぐらい、 スプリントレトロスペクティブは、 「+/Δ」しかしてないので、 あらためて良いのか悪いか考えてみる / Doing Plus Delta for about five years
camel_404
1
350
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
330
Navigating Team Friction
lara
192
16k
KATA
mclloyd
PRO
35
15k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.4k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
53k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
140
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Context Engineering - Making Every Token Count
addyosmani
9
790
Building an army of robots
kneath
306
46k
GitHub's CSS Performance
jonrohan
1032
470k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
300
Ruling the World: When Life Gets Gamed
codingconduct
0
190
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