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
990
Other Decks in How-to & DIY
See All in How-to & DIY
猟銃所持許可を取ってみた
kenkino
2
130
10分de名コミュ “最高の自分”を演じ憧れの同業者と渡り合う
subroh0508
1
620
JAWS-UG/AWSコミュニティ アップデート (JAWS-UG函館支部)
awsjcpm
3
120
放っておくと怖い睡眠負債について/fjordbootcamp-251122
yuukago
3
160
M5StickS3触ってXiaoZhiAI触ってみた #にぼし香 #iotlt
n0bisuke2
0
180
Xの"だるま"とコナミコマンド #iotlt #obniz
n0bisuke2
0
300
20250226_AI Code Agents祭り_MK_AIコーディングエージェントのコラボレーション開発
mk0721
PRO
0
130
LLMを「機能」として組み込む技術:「Figma to はてなCMS」におけるプロンプトエンジニアリングからAIエージェント構築にわたる精度向上の軌跡
nanimonodemonai
0
360
サイボウズには100名以上の社員が出演する"夏フェス"があるって本当?
oguemon
0
560
JAWS-UG/AWSコミュニティ JAWS-UG おおいた
awsjcpm
2
2.9k
JAWS-UG/AWS Communities Updates 2025/11/8 JAWS-UG 島根支部
awsjcpm
1
120
JAWS-UG/AWSコミュニティプログラムのご紹介 (JAWS-UG広島)
awsjcpm
1
110
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Music & Morning Musume
bryan
47
7.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
200
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
67
Exploring anti-patterns in Rails
aemeredith
2
250
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
Automating Front-end Workflow
addyosmani
1371
200k
A Tale of Four Properties
chriscoyier
162
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
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