From: Jim Freeze Date: 2005-03-23T14:11:13+09:00 Subject: Re: Any guides for good coding in Ruby? * Nikolai Weibull [2005-03-23 09:34:16 +0900]: > * Jim Freeze (Mar 23, 2005 01:30): > > One problem with tabs is that people tend to mix tabs and spaces, > > then, when I set the tab to be 2-spaces, I may get 2,3 or 4 spaced > > indents. > > There's no good reason to change the width of tabs. Your editor should > be able to emulate this behaviour anyway. In vim, to get two-space > indents: Thats exactly my point. Let 'v' = space Let '^' = tab Consider: def func statement end For normal code, 'def' is indented 2 spaces. But, when I get a 'tab' persons version, I usually see spaces sprinkled throughout, like so: vvdef v^def ^ def Since I usually get all of these combinations in a single file, there is no one tab setting that will work for all cases. And, 'tab'ers usually don't take measures to ensure there are no spaces mixed in with their indentation. Now, I'm not silly enough to think that this small argument is going to convince anyone not already convinced, to stop using tabs and use spaces only. I just wanted to make it clear that this 'one' reason not to use tabs was valid. There are many others. However, being pragmattic and all, we found it easier in our corporation to follow the ruby standard and use 2 spaces for indentations. It is the first coding standard taught. :) Everybody still uses their tab keys[1], but spaces are placed instead of tabs. And, since we didn't employ superman, no one could tell that the indents were spaces and not tabs when writing or reading code. So, the 'tab'ers didn't care either. -- Jim Freeze Code Red. Code Ruby [1] The main editors were emacs, vi or vim. Each can set tabs to 2 spaces.