Matters of Ruby Style

Some Ruby programmers have very fixed—or even obsessive—views on what constitutes a “Ruby style” of programming. Some, for example, are passionately wedded to the idea that method_names_use_underscores while variableNamesDoNot. The style of naming in which separate words are indicated by capital letters likeThis is called camel case—and that is the last time it will be mentioned in this book.

I have never understood why people get so worked up about naming conventions. You like underscores, I can’t stand them; you say po_ta_toes, I say poTaToes. As far as I am concerned, the way in which you choose to write the names of identifiers in Ruby is of no interest to anyone but you or your programming colleagues.

That is not to say ...

Get The Book of Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.