When coding, do you use spaces or tabs?

I don't code, but I saw Silicon Valley (HBO series, super good) and the main character always said that those who use spaces instead of tabs are psychopaths…

So my question is, which do you prefer and why? 🤔

LET THE HOLY WARS BEGIN!

Jokes aside, tabs, no doubt. They're easier to work with. Editors have great support for them. I think they're aesthetically pleasing and easy to do. Just one key and you're done. Also easier to delete.

I really never understood the spaces crowd, aside from the extra granularity they provide.

But yes, the spaces crowd are psychopaths.

0 Likes
James Kenny

Tabs on Monday

Spaces are for Tuesday

Tabs and Spaces share a Wednesday

Coffee is for everyday

0 Likes

This is the way.

0 Likes
James Kenny

@sergio There can be no other!

0 Likes
Carl Poppa 🛸

Best answer 😂😂😂

0 Likes

This is it. We found the answer!

0 Likes
Sharrc

Eslint has entered the chat.

0 Likes
Ricardo

I'm a tabs guy by nature, but I never really had a dog in this fight until someone made the argument that spaces could make it really hard to read for coders with eyesight issues, so you can now put me firmly in the tabs column. :)

0 Likes

I had no idea. Why is that?

0 Likes
Raz

I only used spaces when I was learning Pascal in high school. So yea, I'm on the tabs camp because they are very easy to use, no need to count them, nice support in editors, can indent a selection of text with it, can indent back using shift+tab in most editors.

0 Likes
Josh Manders Staff

I use a custom extension that randomizes between 3 spaces and a tab.

0 Likes
Carl Poppa 🛸

Is this the episode you're referring to? https://www.youtube.com/watch?v=SsoOG6ZeyUI

Grab a 🍿 and go through the YT comments 😂

And also this has some insightful answers: https://dev.to/_shadz/tabs-vs-space-49l5

0 Likes
Leilany Author

Yes!

0 Likes

In practice, in most modern environments, tabs are implemented as spaces. So in reality there is no difference.

0 Likes
Ali Salah

BTW most of you use spaces and don't realize it :P

VS Code default is to insert 4 spaces per tab. I change it to 2.

0 Likes
Carl Poppa 🛸

cheeky :P

0 Likes

Please sign in to leave a comment.