From: Mike Kasick Date: 2007-07-14T03:14:23+09:00 Subject: Re: Using TABs vs. spaces II. (the Philosophy flamewar reloaded ;-)) On Thu, Jul 12, 2007 at 11:34:55PM +0900, Jan Moli?? wrote: > I read somewhere that good-style Ruby code is indented by 2 spaces. I'd like > to tell you my problem: I'm not disabled, but I have problems with reading > code if the indentation is only at 2 spaces. I must indent more. It's all > about my dysfunction of reading. I have similar vision issues. It takes me a while to parse two space indentation in passages where the indentation isn't obvious from context. Four spaces isn't so bad, and I can fly through eight spaces. > The main argument for using spaces is that the code looks everywhere same. > But - who needs it? From my point of view, I don't care if the code looks > same on my and on my friend's computer. Sometimes I prefer for code not to look the same. If I'm on a terminal with larger text area but a smaller font, I need larger indentation but have the column space to sacrifice. If I'm on an 80 column terminal, eight space indentation results in line wraps, and since the font is bigger I have less trouble parsing 2-4 space tabs. > FINAL QUESTIONS: > > 1. Should there be the only one coding style in Ruby? I would prefer this, > but... It's best to have a consistent coding style across a single project. With free software, it also helps to have a consistent coding style across a language since folks inevitably cherry pick code from multiple projects. That said, I don't think you're going to see excessive complaints over hard tabbed code as compared to other coding style deviations. > 2. Do you think everyone would accept it? No, one group would accept > TAB-style, another group would accept space-style. Maybe there could be two > styles for each group. The real problem isn't whether folks would accept it, but rather would folks acknowledge it. Don't get me wrong, I'm with you here. In my own code I prefer to use hard tabs. However, I rarely advocate their use outside of my own code these days. The problem, as others have mentioned, is that using hard tabs properly requires a certain dedication to consistency. Most people don't have that discipline and will add spaces willy-nilly to make things look right on their screen. The end result is a tab/space combination that's broken for everyone. That's worse than the alternative of spaces only. > 5. Is there any solution for TABs vs. spaces? No, I don't think so ;-) Yes, sadly it's spaces. Although I'd love for the world to accept tabs and use them properly, the only way to avoid the problems that will inevitably result is to go space only.