Spaces vs. Tabs

June 24, 2020
guidelines dev

While looking at writing about guidelines this age-old argument came up as an item...

This one is funny. As someone who's team has not been large and as someone who has typically been the lead and as someone who has (sadly) not participated in enough opensource projects, this was never a discussion.

Tabs. Of course.

Whi what I want to click spacebar 12 times for a line of code that's indented in "three" times? That sounds crazy. Like, seriously, comapre:

tab, tab, tabe - type code

space,space,space,space,space,space,space,space,space,space,space,space, - type code

OMG. I should probably read the arguments on both sides. But it seems so assinine (I know that'snot fair) that I haven't had a chance.

I only bring it up, because as I prepare to write a post on iDesign's guide, which I have had for easily 10 years, I found another guid by Aviva Solutions (https://csharpcodingguidelines.com/and they have "use spaces not tabs" as a guideline.

That definitely seems more opinion than a really good rule to follow for the rest of your life (which is how I've taken Juval's guide). Though maybe the same is in iDesign's. I need to re-read it and check.

Anyway, that's all.

Use TABs. It's more efficient....

OK, as I was wrapping this up I decided to not be that guy and find out what some of the comments around this Holy War are about. And, first< i must share what you should do irrespective of the above:

TABS

Ha!! Gotcha. This biggest thing is spacing. I know that sounds soooo meta, but it's true. It's about the spacing and formtting across all users on all documents on all OSes, etc.

But, in 2020, I think IDEs do a fine job and tabs allow you to control spacing to your preference. Spaces do not. If you want it nice and tight - modify your system to make tabs one space or two. "Normal" can be maintained at four.

I think this is a social conditioning war that was "lost" to whatever the big boys wanted to do at the time (Google, Microsoft, etc.). because, honestly, tabs make more sense. :)