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
Raspberry PiではじめるKiCad入門 / 20240226-rpi-jam
akkiesoft
1
4.3k
銀座線・半蔵門線から、ふりかえりカンファレンス2024現地会場への行き方
pokotyamu
0
290
チームビルディングを受けてみた
harukahosokawa
2
150
AIお菓子ロッカー
keicafeblack
0
130
テストも、国際化も! 小中高生クリエータ支援プログラム『未踏ジュニア』を支える技術
yasulab
PRO
1
140
新婚19年目から学ぶ夫婦円満の正しい歩き方 / Life is beautiful
soudai
12
4.5k
JAWS-UGについて JAWS-UG TOHOKU [青森] 弘前開催
awsjcpm
0
140
Dirbtinis intelektas dizainerio gyvenime
lekevicius
0
230
球体型ロボットと複合現実を活用したマルチエージェントシステム - M5stack Japan Tour 2024 Spring Osaka
tichise
0
260
AWSと学生支援 - Education-JAWS #0
awsjcpm
1
130
2025年03月02日 メイカーズながおかまつり での講演 「コミュニティベースでの製品開発ものづくりフェアの役割」
takasumasakazu
0
220
【1周年】Blueskyちゃん総集編を通じて青空を遊びつくそう
kawaiirailroads
0
330
Featured
See All Featured
The Invisible Side of Design
smashingmag
299
50k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Building an army of robots
kneath
304
45k
Java REST API Framework Comparison - PWX 2021
mraible
29
8.5k
We Have a Design System, Now What?
morganepeng
51
7.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Code Review Best Practice
trishagee
67
18k
How to Ace a Technical Interview
jacobian
276
23k
Being A Developer After 40
akosma
90
590k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
102
19k
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