Your SlideShare is downloading. ×
0
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Ruby On Rails coding conventions, standards and best practices
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby On Rails coding conventions, standards and best practices

6,070

Published on

Published in: Self Improvement, Technology
0 Comments
10 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,070
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
158
Comments
0
Likes
10
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Ruby On Rails coding conventions, standards and best practicesDavid PaluyAugust 2012
  • 2. Philosophy (from Rails)● DRY – Dont Repeat Yourself● Convention over Configuration● YAGNI - You aint gonna need it
  • 3. Source code Style● Two spaces, no tabs● Boolean tests: dont use “and” and “or”, always use “&&” and “| |”
  • 4. Go Easy on the Comments● If its obvious – dont explain it● Remove old commented code● “How to” comments
  • 5. 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
  • 6. Parentheses (Optional)
  • 7. Parentheses (Do & Dont)
  • 8. Folding Up Lines
  • 9. Folding Up Blocks
  • 10. if vs unless
  • 11. while vs until
  • 12. Use Modifier Forms
  • 13. each, NOT for
  • 14. In the Wild
  • 15. Use Symbols to Stand for Something
  • 16. Composing Methods for Humans
  • 17. Make the code a little more articulate
  • 18. Readable Code
  • 19. Readable code makes your classes easier to test
  • 20. Gitthe diff says what you did;your commit message should tell mewhy you did this
  • 21. SummaryGood code is like a good joke: It needs no explanation
  • 22. Credentials

×