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
980
Other Decks in How-to & DIY
See All in How-to & DIY
AIをフル活用! 猫版MBTI「CATS診断」 爆速開発の裏側【個人開発のAIツール活用 LT Night 登壇用スライド】
omori0219
0
1.3k
AWSコミュニティプログラムのご紹介 -グローバル展開するコミュニティプログラム-
awsjcpm
0
250
放っておくと怖い睡眠負債について/fjordbootcamp-251122
yuukago
3
130
AWSコミュニティプログラムとJAWS-UGアップデート / JAWS-UG函館 勉強会 vol.14
awsjcpm
2
180
グローバルAWSユーザー コミュニティとJAWS-UG - JAWS FESTA 2024 in Hiroshima
awsjcpm
0
5k
5年間ぐらい、 スプリントレトロスペクティブは、 「+/Δ」しかしてないので、 あらためて良いのか悪いか考えてみる / Doing Plus Delta for about five years
camel_404
1
290
AWS Community Day 2024: Using AWS to build a launchable knowledge rocket 👉 Organize knowledge, accelerate learning and understand AI in the process
dwchiang
0
260
How to get hundreds of organic backlinks through statistics link building
ronishehu
1
330
苦手の克服方法 / How to overcome weaknesses
toma_sm
0
320
M5Stackサーバーを使って初代プレイステーションでuClinuxのカーネルを起動
kazueda
0
120
파이썬 토룡신점 운영후기
lqez
0
500
2025年03月02日 メイカーズながおかまつり での講演 「コミュニティベースでの製品開発ものづくりフェアの役割」
takasumasakazu
0
290
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
140
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
360
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Designing Experiences People Love
moore
143
24k
Code Review Best Practice
trishagee
74
19k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
260
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
720
Marketing to machines
jonoalderson
1
4.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
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