Live data from Hacker News

The Ruby Style Guide

rubystyle.guide

11–20 of 48 posts

Re: The Ruby Style Guide

#14

I made a comment on this thread[1] in 2014, and it was closed two days ago. I wondered why... guess this is why! 1: https://github.com/rubocop-hq/ruby-style-guide/issues/273

This thread is interesting to me, since I've changed my mind on this topic since I originally commented. :P

I blame Rust, and macros.

Re: The Ruby Style Guide

#15
post #7

I made a comment on this thread[1] in 2014, and it was closed two days ago. I wondered why... guess this is why! 1: https://github.com/rubocop-hq/ruby-style-guide/issues/273

I don’t fully get your point. There is no official style guideline for Ruby.

I'm not sure what your point is either. Mine was "oh, there's a website now; they must have been reviewing old issues to prepare for the launch." There is no "official" style guide, you're 100% right, but I'm not sure what that has to do with this.

Re: The Ruby Style Guide

#16
post #3
post #2

Hard to swallow without any reasons written behind each decisions.

The Ruby Style Guide has been around for a long time now, this is just a nice update. The guide has received ample feedback and edits/additions over the years, with an emphasis on reaching a consensus amongst senior ruby developers and open source contributors. I believe that adding justifications or reasons for each guideline would make the guide harder to read and search. The way it is written now is succinct enoug…

Agreed. I'm just happy to have a style guide that's tasteful enough and well-known among Ruby users. For me, one big advantage of the guide/Rubocop is being able to let other people worry about the little details and variations.

Re: The Ruby Style Guide

#17
post #7

Earlier quoted context omitted.

I don’t fully get your point. There is no official style guideline for Ruby.

I'm not sure what your point is either. Mine was "oh, there's a website now; they must have been reviewing old issues to prepare for the launch." There is no "official" style guide, you're 100% right, but I'm not sure what that has to do with this.

Oh, got you. I thought you were implying some conspiracy to kill conversation or something. Nvm.

Re: The Ruby Style Guide

#18

Earlier quoted context omitted.

I'm not sure what your point is either. Mine was "oh, there's a website now; they must have been reviewing old issues to prepare for the launch." There is no "official" style guide, you're 100% right, but I'm not sure what that has to do with this.

Oh, got you. I thought you were implying some conspiracy to kill conversation or something. Nvm.

Ah, yeah, no worries! I was not :)

Re: The Ruby Style Guide

#19
post #4

Oh fun another style discussion! :-) My own taste is for a "book style": write the code like you see in good books. I agree with most of this guide, although I'm pretty loose and case-by-case in practice. I've gradually added rubocop to lots of my projects, but then I wind up disabling tons of the rules. I'm sad all the Ruby guides I've seen ban "and" and "or". I don't find them to be such an issue, and they are nice…

> I'm sad all the Ruby guides I've seen ban "and" and "or". I don't find them to be such an issue, and they are nicer to type & read

I generally prefer `&&` and `||` for purely aesthetic reasons; they're much taller characters, so I can easily see the division between clauses. `and` and `or` look too much like identifiers (even with keyword syntax highlighting), so my eyes tend to gloss over them at first glance.

Out of curiosity, was the use of `&` in "type & read" intentional to try to demonstrate your point? My preference is interestingly the opposite for natural language; using tall punctuation like that feels too obtrusive for me in the middle of what usually is a bunch of lowercase letters.

Post reply on HN