From: ptkwt@... (Phil Tomson) Date: 2005-03-23T10:39:50+09:00 Subject: Re: Any guides for good coding in Ruby? [OT] tabs vs. spaces In article <4240A7A2.4050703@infofiend.com>, 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. Amen. and I am a vi user (see below). The lucky thing for us Ruby users is that the number of spaces/tabs (while the two might look the same on the screen) doesn't matter to the interpreter as it does with another language that starts with a P. > >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. > Actually, there are autoindent modes for vim - there's one for Ruby code. Phil