(think)

An online novel about the Source, the Force, the real life and everything in between...

The Elements of Style in Ruby: An Essay in N Parts

The Ruby Style Guide is nearing its second birthday. The project has gained more attention and more traction than I could have imagined. For the millionth time I was amazed by the fantastic Ruby developers around the world.

The project has also steadily evolved:

  • it covers more and more aspects of programming in Ruby
  • it features many more code examples
  • it is now translated in several languages
  • it gave birth to the automated static code analyzer RuboCop
  • it has become the basis for hundreds of slightly modified internal project or company style guides

One common criticism for the Ruby style guide is that it doesn’t feature extensive rationale about most of the rules in it. That’s deliberate – even now the document is pretty intimidating. If we were to delve into the reasoning behind each and every rule, the guide’s size might come close to that of a small book.

I do, however, feel that the rationale behind some of the rules is important. That’s why I’ll be starting a series of N posts devoted to the topic. I’ll try to cover as many of the rules as I can – from the more straightforward ones like maximum line length, to the most controversial ones like the use of single-quoted strings when possible. The articles will be published in no particular order and on no particular schedule.

Keep an eye out for the installments in the series here and on Twitter. I’m looking forward to many interesting discussions with you!

Feel free to take a look at the first article in the series, dedicated to the maximum line length we should aim for.

Articles in the Series

Comments