Hacker News new | ask | show | jobs
by SwellJoe 3831 days ago
Anyone know why Ruby is 100% for 2 spaces? That seems impossible. Even Go isn't that consistent and it has gofmt which seemingly everyone uses.
2 comments

I was taken aback by this as well. The Ruby community lets opinions be strong, and tends to converge on 'standards,' so I expected 2 spaces to be a strong winner. But beating out go, which ships with `go fmt`, is a pretty impressive community-wide commitment.
The GitHub style guide agrees: https://github.com/styleguide/ruby
Here's the thing though, Python has PEP-8, which is _the_ style guide for Python, and even that is only 91% 4-spaces. So that's pretty much the upper limit on the impact of a style guide on a language's conventions, I would imagine.

Go gets even higher, but only because there's an expectation of gofmt usage which converts spaces to tabs.