The notorious tabs vs spaces .. vs whitespace?

The notorious tabs vs spaces … vs whitespace?

In our April News, we shared a fun announcement letting you all know we are giving away sticker packs for everyone that fills out their profiles. A bunch of you did just that and were hit with the question Tabs/Spaces?

Do you mix it up? Do you use no indentation at all? They’re both pretty much the same right?

But honestly, we’d love to find out what you think. Share your thoughts with us! Do feel more productive using one over the other? Do you believe the editor/IDE you use influences your choice? Or visa versa?

tabs

But let’s be honest, we all love the whitespace.










Right?

This is no longer an issue… is it? Set up your editor / IDE for whatever you like, auto-prettify source code on file open & save… I have no idea how my other developers indent their code, by the time I’m looking at it it’s indented the way I like it! Friendly Reminder: for a setup like this to work, your source-code control has to be configured to ignore whitespace.

I like my code pretty and always suitable for copy-paste into documentation… but I don’t expect my colleagues to think/feel that way. Whitespace pluralism, yeah!

1 Like

I remove all whitespace before commiting to the SCM. No ambiguity.

In all seriousness it really depends on the lanugage and the community standards around that language. If you’re not following a style guide, or you don’t have a method of enforcing it, you wider array of problems than tabs versus spaces. :slight_smile:

I think most standards in most languages do conform to spaces though, and a part of that is down to the variable nature of tabs. It could be argued that you can then customise tab size to your comfort however this isn’t great if you’re pairing / rubber ducking.

In JavaScript, which is what we use on the Auth0’s web workers, the most commonly followed standard is AirBnb, which is explicitly spaces, two per indent.

2 Likes

Deleted upper message from @zozo36769 because of inappropriate content.