Re:Spaces or Tabs?
by els on Friday October 02, 2009 @03:01PM
(#857736)
I started this out of a spirited conversation between my boss and I. We've been using tabs for years; the argument being that anyone can adjust their tab width to whatever they prefer. As Daniel said, in theory this works but in reality it never allowed for circumstances where you'd need to indent something an odd (or if your tabwidth was odd, even) number of spaces. For example, check out Google's style guide for C++: http://google-styleguide.googlecode.com/svn/trunk/cppguide.x... You can't format those function arguments like that using tabs. This kind of granularity is essential, especially working in a team environment.
[ Parent
| on HN ]
For lining up arguments like that, (esp with long objc calls), I use spaces after indenting to the level the code is indented. For instance,
[\t]int val = 0;
[\t]callSomeFunction(someOtherVal,
[\t].................val);
Anywho, it's a religious argument with no right answers. I was just justifying my preference.I prefer the same but it's a pain to line it up manually like this. I usually settle for vim's = operator, but that has the frustrating behavior of using as many tabs as possible (according to your tabstop) until using a few spaces. I can't find any way to change this; anyone know of a vim plugin to circumvent it?