Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I'd strongly advise you not to use tabs for Ruby, just because it's a community very heavily based on stylistic consistency

I've published plenty of gems and open source Ruby work and I choose how I write my code, thanks, and I couldn't care less what the "community" thinks about tabs vs spaces. The "community" believes all sorts of nonsense and if they don't like my code they can fork it and "fix" the tabs. That may sound a bit combative but I don't take well to being told I'm the nail that stands up too much.

My views on tabs changed based on something I read of Samuel Williams (it could be this[1] or this[2]) that was entirely reasonable (note his far more gentle rebuttal than mine with the key phrase being evidence based), and I'd consider him one of the top ruby devs.

As to the keywords example, I use tabs all the time with that style - what problem am I supposed to encounter?

To the other example with the array constructor sugar, I tried it with tabs, I didn't see a problem:

``` helpers = %w(resource scope_name resource_name signed_in_resource resource_class resource_params devise_mapping)

helpers.each do |h| puts h end

$ ruby test.rb resource scope_name resource_name signed_in_resource resource_class resource_params devise_mapping ```

Apologies if the HN markdown sytax means this get mangled, no idea if it'll take fenced code blocks but you get my drift.

[1] https://github.com/ioquatix/universal-style-guide#indentatio...

[2] https://github.com/ioquatix/rack-freeze/issues/2#issuecommen...

Edit: It did get mangled :/ there's a newline and then plenty of tabs in there. Worked like a charm.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: