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
What I Talk About When I Talk About Social Media
idealhack
0
110
obnizを制御するChatGPT自作プラグイン #iotlt #chatgpt
n0bisuke2
2
550
ライトニングトーク: JAWS-UGが凄いぞ、という小ネタ
awsjcpm
0
110
LT(Lightning Talk)のドキドキ感を共有する IoT ぼっとキーホルダ!
scbc1167
0
250
LT(Lightning Talk)のドキドキ感を共有する IoT ぼっとを作った話
scbc1167
1
150
ちょっと待てぃ!!ボタンをキーボード化 #M5Stack #M5JPTour2023 #相席食堂
n0bisuke2
0
570
中指立てたか判定IoT #iotlt #p5js
n0bisuke2
0
220
ついにiPaaSでobnizが動くかも?! #iotlt #pipedream #obniz
n0bisuke2
0
320
Chaos V-Ray Render Pool Manual [EN]
renderpool
0
360
GPT-4oに遅刻理由を考えてもらうボタン #gpt_4o #iotlt #chatgpt
n0bisuke2
0
220
カフェでノートPCが盗難されたかどうかを検知するIoT #linedc #iotlt #obniz #protoout
n0bisuke2
1
270
[너구리랑! 회고 밋업 2023] CTO 1년 회고와 회고를 바탕으로 만든 프로젝트에 대한 회고 - 전문가가 되는 방법 // 한날 님
develop_neoguri
0
130
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Designing the Hi-DPI Web
ddemaree
280
34k
The Cost Of JavaScript in 2023
addyosmani
45
6.6k
Thoughts on Productivity
jonyablonski
67
4.3k
Code Review Best Practice
trishagee
64
17k
What's new in Ruby 2.0
geeforr
342
31k
Fireside Chat
paigeccino
32
3k
Become a Pro
speakerdeck
PRO
24
5k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
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