Skip to main content Accessibility Feedback

Tabs are objectively better than spaces

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. That’s it. That’s the entire reason why tabs are better.

Now, I know, I know. Something something something consistent look across different people’s environments and so on. That’s a bug, not a feature. You’ve robbed developers of choice.

I have ADHD. Two spaces per indent makes it damn near impossible for me to scan code. My brain gets too distracted by the visual noise. Someone who’s visually impaired might bump their font size up really large, and need to scale up or down the amount of space per indent. Someone might just prefer it because

The reason really doesn’t matter.

What matters is that tabs let developers control how much space each indent has, while also allows you to set it to your preferred size. Everyone wins!

An update from my friend Ben Myers! Ben is an accessibility advocate, and messaged me after I published this to share another reason why tabs are objectively better…

Another accessibility reason for tabs: when using a braille display, each space takes up one character cell, so indenting with four spaces eats up four cells. Indenting three times with four spaces each eats up 12 characters already. Tabs only take one character cell each, so three indents = three character cells used.

Given many, if not most, braille displays are 40 cells long, and that 70-to 80-cell displays are considered a luxury, and you can see how cutting 12 space characters down to 3 tab characters could be really, really helpful.