Tabs or spaces? For practical JavaScript developers, the answer is clear.

Monarch Wadia
Mintbean.io
Published in
3 min readApr 1, 2021

--

Photo by Alexander Andrews on Unsplash

Premise: career growth is ultimately more important than technical purity.

We’re software engineers and developers. We are not scientists. Not philosophers. Most of us do what’s right for the business, and aren’t above making practical sacrifices when the business needs it.

We should make the same pragmatic decisions when it comes to navigating our own careers. When it comes down to it, tabs v/s spaces is just splitting hairs and isn’t worth losing money over.

If you don’t agree with this, you should stop reading. You won’t like where this article is going.

Using spaces is WAY better for your career.

This is because in JavaScript, there is a HEAVY perception bias against tab users.

Most ES6 developers look down on anyone who uses tabs. This could easily mean the difference between getting a job offer and being rejected. It could mean tens of thousands of dollars of salary potential.

The reasons for this are simple.

  1. Most experienced ES6 engineers use ESLint, which dominates the linting market today.
  2. In turn, ESLint pushes AirBnB, Standard and Google style guides on its users.
  3. As a result, the style guide market is dominated by AirBnB, Standard and Google .
  4. All of these style guides recommend 2 spaces.

Therefore, tabs tend to be used by inexperienced JS devs... and they’re heavily associated with them.

Now look, I know it doesn’t ACTUALLY make a technical difference. And if you split hairs, tabs are better.

But guess what. Experienced software developers are not rational creatures. They’re as irrational and biased as the rest of us. And because of the above ecosystem realities, they mostly use spaces, and discriminate against tabs.

You should also avoid 4 spaces for the very same reason. 4 spaces are also used by inexperienced JS devs — but less so.

This bias is not worth fighting.

As human beings, we naturally want to fight all bias and prejudice. We naturally want to fight for what’s right.

This time though, think about what’s at stake. Nobody’s being discriminated against based on identity, race, gender, ethnicity, country of origin, or anything remotely important in the grand scheme of things.

All that’s happening is: you look like a noob when you use tabs.

It’s a faux pas. Like oversharing on your resume.

So I just don’t think it’s worth fighting it. Seriously. You probably have bigger problems. This time, evil wins. And I’m OK with that, because the consequences are not that terrible.

I’ll admit it: from a pure engineering perspective, tabs are far better than spaces.

They take up less space on your hard drive. They are adjustable. They even look prettier than spaces. Et cetera. See the second answer on this stack-exchange thread (and notice how it is much better-reasoned than the one arguing for spaces).

I’m a tab lover.

But I’ll never use them in JavaScript.

(Yes, it’s unfair. Don’t shoot me, I’m just the messenger. I won’t debate this. Feel free to start a flame war in the comments section though, it’s good for business.)

Want more practical career-oriented advice? Join Mintbean.io

Mintbean is the best place for career-driven JavaScript developers to hang out with like-minded people. We do free programs like learnathons, career workshops, technical workshops and more. We also have a Discord with more than 2,000+ developers in it. Come check us out.

--

--