this post was submitted on 17 Jun 2023
150 points (98.7% liked)

Programmer Humor

32192 readers
203 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
(page 2) 17 comments
sorted by: hot top controversial new old
[–] StoryVander 1 points 1 year ago

I have to come in here and comment because I can’t let the slander continue.

You can use either spaces or tabs, both options are viable. There are different reasons to choose each. I am sick and tired of hearing elitism from people thinking they have the objectively correct answer. I’ve been in this debate for a long time and it’s more toxic now than it ever has been. It used to be that each camp fought for the virtues they liked about their choice. Now that accessibility is a mantra of the tab camp, that’s all they talk about and they assert that their values are the only ones that matter - without evidence.

There are plenty of good reasons to use spaces. The biggest of which is if you care about line lengths in any capacity. There are many reasons to care about line lengths.

  • Government requirements
    • Believe it or not, some projects still require code to be printed out, and how the code looks printed matters.
  • Heavy terminal use
    • Projects where code is frequently accessed though a terminal greatly benefits from a maximum line length.
  • Three-way merges
    • If you're ever in a situation where you want to see three versions of the code on a single screen, maximum line length matters.

I'm sure there are more.

If you use tabs, the only way to accommodate a maximum line length is to enforce a particular tab width. Which is almost always better to do by using spaces.

There is a reason almost every language style guide says to use spaces. Go is the only modern language I'm aware of that says tabs. It's mind-boggling to me that people will look at nearly the entire industry and say that they're crazy or malicious or uncaring. That obviously can't be true. The reality is that there are in fact decent reasons to use spaces.

And of course tabs are fine too. If you don't care about strict maximum line length requirements, then there isn't much of a reason to use spaces. There are few other reasons, but they're not very strong. So feel free, use tabs in your company and on your projects.

But drop the elitism where you assert without evidence that because a tiny minority of people have to spend a few hours of their time configuring their special tools to work with spaces the entire industry has to drop all their other values and preferences to save them that time.

Please, do feel free to disparage maximum line lengths, or bloated file sizes, or whatever else. Let the Holy War continue. I'm just sick of people pretending that the debate is over just because they say so.

If I had to venture a guess as to why spaces-users make more money, it's probably just because that's what all the tools are pre-configured for. People that just use the defaults and get going are likely more productive than those who rabidly obsess over something like whitespace. I expect the reverse would be true if tabs were the default. But that's pure speculation, I truly have no idea.

[–] [email protected] 1 points 1 year ago

Well, spaces are superior, so…

[–] [email protected] 1 points 1 year ago

I let the editor handles the formatting, so I make no money

load more comments
view more: ‹ prev next ›