If you want to know whether spaces or tabs are best, it’s simple, find out yourself by starting a flame war.
Starting a Flame War
Those who know me, are generally aware that I sometimes like to stir things up on a Friday afternoon. This was especially true in the pre-covid era when a Friday lunch was the social highlight of the week.
So on occasion, I would post the following in the main developer channel and effectively start a flame war1.
“Our coding standard dictates Tabs, personally I feel spaces are better.”
That’s all it would take to let the carnage begin.
The Arguments
This would always take the same form.
The noisy ones would start first and come out swinging.
But, if you waited long enough, even the quietest members of the teams would come out of their shells.
Within a pretty short period of time, you would have a load of people participating vigorously, with some getting pretty vicious on occasion.
The arguments are well known, so the following would always be mentioned.
- .. takes less memory
- .. can be adjusted to your personal preference
- .. is better for accessible first.
- .. require fewer keystrokes
- ..
- etc
All with no really compelling argument.
The Answer
After a while, despite a lot of back and forth, no side would gain traction.
Realizing this, someone smart would post the following.
“Looks like there’s no real winner here, I guess we just stick with tabs.”
QED
And just as quickly as it had begun, the arguments would stop.
Learnings
So by the time the chat had come to its natural end, what had everyone learned?
The die-hards will have learned nothing – they will have the same opinion as they initially held.
But for the majority of those involved, there were 2 clear learnings.
- Having a standard is all that matters
With modern tooling, there is no standout winner between tabs and spaces. It’s having a standard that counts. - Everyone knows the standard
By the time the chat was done, everyone knew the preferred standard.
Not much point in having a standard, if people don’t know what it is.
You should enforce it with tooling, just in case.
Wrap Up
Most people realize the Spaces vs Tabs debate is just a bit of a circus sideshow in the world of software engineering.
It’s marmite, religion, and sausage vs bacon sandwich all rolled into one.
Having a standard is really all that’s important. What you choose is not likely to make or break your development effort and it’s definitely not going to be your biggest problem.
However the above is a pretty fun way to see what people think about it, especially if you’re sitting back, just watching what’s going on.
So the next time you want to let everyone know what a standard is, or gauge opinion for a wee bit of fun, why not start your own flame war?
It works for more than just spaces vs tabs.
References
1 Flame wars are probably known in Agile environments as experiments.
Leave a Reply
You must be logged in to post a comment.