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
120
Debugging and Profiling Rails App
dpaluy
3
210
Faster on Rails
dpaluy
2
200
How to Prepare 3 min Fundraising Presentation
dpaluy
0
980
Other Decks in How-to & DIY
See All in How-to & DIY
お家で育てる制御実験環境
zilmina
0
880
PlatformIO IDE用M5Stack定型コード環境の紹介
3110
1
370
リアル登壇だから気をつけたい「マイクの使い方」のコツ
shirayanagiryuji
0
190
音に負けない!子どもが騒いでいる脇でも快適オンラインMTGの秘伝
kaitou
0
320
「AITRIOS」でトカゲの活動量を可視化
hoshinoresearch
0
320
LEGOでRecord Playerを作った話 #LEGOrdPlayer
keicafeblack
0
120
バタフライ効果/butterfly_effect
florets1
0
250
BVEと連動する誤自宅運転台のススメ!
usashirou
0
640
こんなにあるの? 最近のIPAトレンドを ざっくりまとめてみた
watany
3
630
ファシリテーターの美意識_株式会社コミュカル Mitz
comucal
PRO
0
260
それっぽいポッドキャストの作り方
khirata
2
280
AWS User Community - JAWS-UG/AWS ユーザーコミュニティのご紹介
awsjcpm
1
140
Featured
See All Featured
Building Your Own Lightsaber
phodgson
103
6.1k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Navigating Team Friction
lara
183
15k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
A designer walks into a library…
pauljervisheath
204
24k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Agile that works and the tools we love
rasmusluckow
328
21k
No one is an island. Learnings from fostering a developers community.
thoeni
19
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