For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | els's commentsregister

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.


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?


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You