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
220
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
JAWS-UGのご紹介 JAWS-UGとは?
awsjcpm
0
4.9k
バーチャルバナナとリアルバナナ #iotlt #TouchDesigner
n0bisuke2
0
130
骨折と入院とIoT #iotlt
n0bisuke2
1
270
Snowflake WEST ユーザー会第2回「ハンズオンセッション」
mabokaneko0802
0
260
とある航空会社の飛行機の乗り方をお教えします。/20240913-lt
kwada
3
260
いぬぬウォッチャー - オレトク賞オンライン決勝 #ヒーローズリーグ
n0bisuke2
0
150
アイデアをカタチにする、イマジニア
haruka_imgr
0
110
What I Talk About When I Talk About Social Media
idealhack
0
160
GPT-4oに遅刻理由を考えてもらうボタン #gpt_4o #iotlt #chatgpt
n0bisuke2
0
320
How to create better speaker proposals
logico_jp
2
710
【1周年】Blueskyちゃん総集編を通じて青空を遊びつくそう
kawaiirailroads
0
320
生成AIとミニ四駆で学ぶ! MATLAB/Simulink
covao
1
240
Featured
See All Featured
How GitHub (no longer) Works
holman
314
140k
Become a Pro
speakerdeck
PRO
26
5.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Code Reviewing Like a Champion
maltzj
521
39k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
The Language of Interfaces
destraynor
156
24k
Rails Girls Zürich Keynote
gr2m
94
13k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Cult of Friendly URLs
andyhume
78
6.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
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