Yesterday, I shared some spicy takes. A few were particularly controversial—most notably, that I correct Gif the correct way (with a soft G)—but I also got a lot of emails asking me to elaborate on a few of them.
Today, I wanted to talk about how tabs are objectively better than spaces. This won’t take long.
Tabs let you define how big you want each indent to be, and spaces do not.
The idea is good, but it evidently failed. Most guidelines and newer Tools recommend or require or use spaces for indent.
They have their reasons too.
The prevalence of spaces makes it hard to make a contrary argument for tabs. By now, I don’t think it’s worth even if it had reasonable advantages.
Editors/IDEs that parse syntax can adjust space indent too. A mixture for indent and alignment is not obvious for everyone (I always display whitespace in my editors and am deliberate and consistent, but many people and editor defaults won’t be). Some defaults of four or eight space-width tab display is atrociously wasteful and inaccessible.
Spaces are a good enough baseline. It works well enough. And most importantly it works consistently. That’s why it won in prevalence and use.
I would have preferred tabs to win for this reason.
Unfortunately, as you pointed out, “good enough” can be excluding, non-inclusive. Overall it works well enough for enough people / none with impairment stumbled over it yet, did not voice or were not heard.
the majority of healthy people has no problem marginalizing minorities with disabilities
I wouldn’t attribute malice like this though. Most people just don’t care or are not mindful and thorough.
If I could only get everyone who works on the thing I work on to use a whitespace visualizer, it would be enough. We can fight about tabs or spaces after we get rid of all the unnecessary trailing ones.
I created a tool for removing trailing whitespace across the whole project. After cleanup now it’s at least only a matter of pointing it out in reviews and occasionally fixing landed sources.
I consider tabs for indentation a failed concept.
The idea is good, but it evidently failed. Most guidelines and newer Tools recommend or require or use spaces for indent. They have their reasons too.
The prevalence of spaces makes it hard to make a contrary argument for tabs. By now, I don’t think it’s worth even if it had reasonable advantages.
Editors/IDEs that parse syntax can adjust space indent too. A mixture for indent and alignment is not obvious for everyone (I always display whitespace in my editors and am deliberate and consistent, but many people and editor defaults won’t be). Some defaults of four or eight space-width tab display is atrociously wasteful and inaccessible.
Spaces are a good enough baseline. It works well enough. And most importantly it works consistently. That’s why it won in prevalence and use.
deleted by creator
Do you have actual experience with it?
Some time ago I read a comment from someone with impaired eyesight who used an editor that would adjust space indent just fine.
Accessibility is a thing I always consider.
deleted by creator
I would have preferred tabs to win for this reason.
Unfortunately, as you pointed out, “good enough” can be excluding, non-inclusive. Overall it works well enough for enough people / none with impairment stumbled over it yet, did not voice or were not heard.
I wouldn’t attribute malice like this though. Most people just don’t care or are not mindful and thorough.
If I could only get everyone who works on the thing I work on to use a whitespace visualizer, it would be enough. We can fight about tabs or spaces after we get rid of all the unnecessary trailing ones.
You’ve a .editorconfig in your repo right? Right?
In case folks aren’t aware, https://editorconfig.org/
I’m glad someone linked this. Should be further up in this thread.
I created a tool for removing trailing whitespace across the whole project. After cleanup now it’s at least only a matter of pointing it out in reviews and occasionally fixing landed sources.