From: Bill Guindon Date: 2005-03-23T08:54:03+09:00 Subject: Re: Any guides for good coding in Ruby? [OT] tabs vs. spaces On Wed, 23 Mar 2005 08:17:53 +0900, Ben Giddings wrote: > Martin Ankerl wrote: > >> I try to follow the style that is predominant in the Ruby parts of the > >> Ruby source. Also, see: > > > > I also do this, but there is one thing I cannot stand: every ruby lib > > uses 2 spaces for indentation! IMHO it should be tabs, and *only* tabs. > > This is much better, because in almost every editor it is possible to > > set the tab width to whatever one likes. I hate 2 spaced sourcecode, > > because I usually set one tab == 8 spaces, and use a non-fixed font. > > Yay! Let's start a tabs vs. spaces flame war!! > > My view? Tabs should never, ever be used in a file. (Ever) Can you > have a source code file without spaces? I doubt it. Can you have a > file without tabs? Certainly. Is mixing the two the main problem? > Yup. Use only spaces. > > It's funny though. I think this eternal flame war is related to the > other eternal flame war: vi vs. emacs. In Emacs, the 'tab' button is > most often bound to 'indent-command'. This and 'indent-region' makes it > really easy to use spaces for indentation, and to adjust/fix someone > else's indentation when it's bad. On the other hand, I think vi makes > it much harder to use spaces for indentation, so tabs seem more attractive. > > Anyhow, before throwing in your views, at least read up on other > people's arguments. :) > > http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%22tabs%20vs%20spaces%22 Ok, I did (some) of the required reading, and found some of those people are crazier than I am (which says a lot, but it's probably a good thing). My issue with tabs is mostly due to working on the web a lot, and using admins that are composed of many textareas. AFAIK, there's not a browser out there that lets you configure tab width in textareas, and they all seem to default to the "traditional" 8 spaces. btw, Mozilla 1.7.2 here, and if you know how to set that, I'll be happy to hear it, but I'll continue to use my 2 spaces :) Whatever you use (or come across in a file), shouldn't matter too much, as most programmer's editors allow that to be changed fairly easily. -- Bill Guindon (aka aGorilla)