Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Back in the day, a lot of programming revolved around reporting. One reason I can think of would be laying out columns on reports, on terminals that didn't support proportional fonts.

A lot of people rail against tabs; most of the time, these are people who don't understand them or have never tried to use them.

You see this debate about tabs vs. spaces in code all the time, and I've yet to hear any valid argument about why spaces are better (at least in any modern context). But there is an obvious reason that tabs are better: It's much easier to line things up, keep them aligned across different users' fonts, and realign them if you change the text to cross a tab.



How quaint, another person who insists that people who don't use their preferred formatting just doesn't understand it! Never mind that maybe they just disagree--there has to be something wrong with them, right?

I don't use tabs because of an equally obvious reason that spaces are better: because I end up padding with spaces because the tabs are too big. For example, I like having horizontally consistent parameter argument lists, like below:

   class Thing {
       def beep(bar: String, baz: Int, quux: Seq[String],
                quuux: Map[String, String], quuuux: Int) = false
   }

If I tried to use tabs there, I'd be off by a space and have to add another space. Someone with a different hard-tab width would then get mad because there's an "extraneous" space in their view. And then we all have a nice big slapfight and sound like your post in the process.

(Plus, my editor treats four spaces in a row as a soft tab anyway, so I don't even notice it except when I want to. Life is peachy.)


I pointed out that they never give a specific reason for preferring spaces. At least you did that.

You can still achieve what you want, and even faster, by using tabs to get your subsequent parameter lines most of the way there and then padding with a couple of spaces.


I covered that exact "solution" in my post--the exact one! It blows up when somebody else is using a different tab width than I am. And given that I use soft tabs, it is no faster at all.




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

Search: