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
990
Other Decks in How-to & DIY
See All in How-to & DIY
終わりのない会議を超えて:HolacracyのTactical Meetingを体験しよう!
andrearc
0
190
Azure PortalのQoLを上げてたら Big Techに怒られた
horihiro
2
560
いしかわ暮らしセミナー~知って安心!移住とお金講座~
matyuda
0
140
How to make the Groovebox
asonas
2
2k
人はなぜコミュニティとつながると幸せを感じるのか
448jp
3
380
JAWS-UG/AWSコミュニティ JAWS-UG おおいた
awsjcpm
2
2.9k
AWS re:Invent 2024 re:Cap – AWS Community Perspective
awsjcpm
0
110
雑にコミュニティを続けてもいいと思っている/Feel free to continue the community
camel_404
0
350
エッジで動くNode-REDを作る実験 #noderedjp #noderedcon
n0bisuke2
0
470
10分de名コミュ “最高の自分”を演じ憧れの同業者と渡り合う
subroh0508
1
630
多摩ニュータウンを、 味わう
aokiplayer
PRO
0
330
JAWS-UGとAWS - JAWS-UG彩の国埼玉設立のお祝い
awsjcpm
2
630
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.3k
Agile that works and the tools we love
rasmusluckow
331
21k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
380
Darren the Foodie - Storyboard
khoart
PRO
3
2.7k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
200
Accessibility Awareness
sabderemane
0
71
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
82
Game over? The fight for quality and originality in the time of robots
wayneb77
1
130
sira's awesome portfolio website redesign presentation
elsirapls
0
170
Done Done
chrislema
186
16k
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