“Beauty is more important in computing than anywhere else in technology because the software is so complicated. Beauty is the ultimate defense against complexity.” We are trying to make Ruby more clear and therefore even more beautiful, so we are presenting The Ruby Style Guide updated – a comprehensive source on how to write Ruby code.
This Ruby style guide are recommendations of the best practices of Ruby programmers. So, if you are a real Ruby programmer, it will be easy for you to understand. The guide is composed in the form of several sections. Most of the guidelines are based on the questions that were raised during some programming work and contain answers, experience, and suggestions of the Ruby community and many specialized Ruby resources.
We’ll give you a sample of recommendations given in guidelines:
- Use one expression per line.
# bad puts 'foo'; puts 'bar' # two expressions on the same line
puts 'foo', 'bar' # this applies to puts in particular
- Do not put a space between a method name and the opening parenthesis.
snake_casefor naming files, e.g.
- Aim to have just a single class/module per source file. Name the file name as the class/module, but replacing
Please feel free to read the guidelines by yourself here.
And check our Monthly trending Ruby on Rails repositories’ digest with a Ruby gem to bundle gems, a syntax highlighter, a framework for website administration, a gem to define behaviors between classes and many other great open sources Ruby/Rails projects on GitHub!
Btw, if you’re looking for Ruby programmers, ask Syndicode!