VOOZH about

URL: https://thenewstack.io/spaces-vs-tabs-a-20-year-debate-and-now-this-what-the-hell-is-wrong-with-go/

⇱ Spaces vs. Tabs: A 20-Year Debate Reignited by Google's Golang - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2016-09-17 09:29:43
Spaces vs. Tabs: A 20-Year Debate Reignited by Google's Golang
analysis,
Software Development

Spaces vs. Tabs: A 20-Year Debate Reignited by Google’s Golang

Sep 17th, 2016 9:29am by David Cassel
👁 Featued image for: Spaces vs. Tabs: A 20-Year Debate Reignited by Google’s Golang

Geeks have been choosing sides for the past 16 years — should programmers indent their code using spaces or tabs? But now the infamously trivial flame war has been given a new prominence by a study from Google — possibly inspired by the dialogue in a recent episode of HBO’s Silicon Valley.

“Truth be told, I do have a slight preference for tabs. But that’s only because I’m anal and because I prefer precision.”

“Well, not to pick a fight here, but if you really care about precision, wouldn’t you use spaces? But whatever, once it goes through the compiler, it’s the same thing, right…?”

“If it’s all the same, why not just use tabs?”

“Because it could look different on other people’s computers.”

“Tabs create smaller file sizes, all right…? I mean, why not just use Vim over Emacs?”

“I do use Vim over Emacs.”

“Oh, god help us!”

Finally this year — right before the Labor Day weekend — Google’s developer advocate decided to weigh in. “We are going to parse a billion files among 14 programming languages to decide which one is on top.” They crunched files from the top 400,000 GitHub repositories, looking at only files of code written in the top languages — and their chart showed that spaces were by far the most popular method of indenting, in every language. Except Go and C.

“Confirmed, Go is the language of the future,” joked one commenter on Reddit.

“It also automatically formats your source code,” countered another programmer. “I use spaces, and it spits out tabs!”

And on Twitter, one developer joked the essay had only created another controversy. “The new discussion is now ‘what the hell is wrong with Go?‘”

At least one Canadian engineer applauded the effort that Google put into settling the question.

https://t.co/wuMz1gLwXT that's how you settle am argument: data.

— Ian Fosbery (@fozcodes) September 8, 2016

But in the end, Google failed to bring peace to the developer world.

https://twitter.com/ibc_tw/status/776052508007555076

When someone referred Castillo to Google’s analysis, he simply added “I knew that. And yes, they all are 100% wrong.”

“What is this madness,” tweeted cloud engineer Ed Morgan.

“Madness everyone knows tabs are better!” replied a London-based NetApp maintainer.

“This is disgusting,” tweeted one freelance web designer in the U.K.

And it didn’t end there. Google’s post soon went viral, drawing 1,620 comments on Reddit, and also turning up on Gizmodo, Slashdot, and Hacker News. “After 20+ years of listening to the tabs-vs-spaces debate and considering all the legitimate points that both sides have, many have made the following observation and it’s what resonates with me the most,” wrote one programmer on Hacker News.

“In an ideal perfect world, _all_ of programmers and _all_ text editor tools would use tabs specifically for indentation and spaces specifically for alignment. But, we don’t live in that perfectly coordinated world so spaces maintains the most fidelity — at the expense of programmers not being able to instantly customize the indentation from widths of 2,4,6,8.”

Have geeks really been arguing about this for 20+ years? Looks like it. It was already being described as an “interminable argument” by Jamie Zawinski, one of the coders on the early Netscape Navigator browser — back in 2000. His post explained how to configure two Linux text editors (Emacs and Vi) to change the tabs to various widths. (“So go forth and untabify!”)

Merrily we rolled along, and in 2004, a post on the Microsoft Developer Network took up the very same issue, noting that some people combine spaces and tabs, and arguing that they’ve actually staked out a fourth position: coding tools should be configurable to display each user’s preferred view, while saving code in accordance with an agreed-upon set of rules. But not everyone was so open-minded. In 2009, Jeff Atwood, one of the co-founders of Stack Overflow, wrote a blog post called Death to the Space Infidels!. He lobbies for his position by citing the beloved 1984 book Code Complete.

“Our studies support the claim that knowledge of programming plans and rules of programming discourse can have a significant impact on program comprehension… It is not merely a matter of aesthetics that programs should be written in a particular style… programmers have strong expectations that other programmers will follow these discourse rules. If the rules are violated, then the utility afforded by the expectations that programmers have built up over time is effectively nullified.”

And Atwood cites more experiments — one from the early 1970s — which found that information is retained better when it’s arranged in a meaningful order. “So yes,” Atwood concludes, “absurd as it may sound, fighting over whitespace characters and other seemingly trivial issues of code layout is actually justified. Within reason of course — when done openly, in a fair and consensus building way, and without stabbing your teammates in the face along the way.”

Four years later, the question turned up in the heart of geek nation — in a discussion on Stack Overflow.

“Spaces,” reads one argument. “A tab could be a different number of columns depending on your environment, but a space is always one column.”

“Tabs,” reads the counter argument. “They’re a character specifically meant for indentation. They allow developers with different preferences in indentation size to change how the code looks without changing the code”

So there!

👁 Silicon Valley - spaces vs tabs

But the tabs part of the page ultimately strikes a conciliatory note. “Of course, consistency matters more than either one, and a good IDE makes the differences negligible.” But why spoil a good argument? “That said, the point of this thread is to be a holy war, so…”

And Jeff Atwood himself seems to agree — to a point. Back in 2009, he wrote “It doesn’t actually matter which coding styles you pick. What does matter is that you, and everyone else on your team, sticks with those conventions and uses them consistently.” But he couldn’t resist adding one more sentence.

“That said, only a moron would use tabs to format their code.”

WebReduce

TRENDING STORIES
David Cassel is a proud resident of the San Francisco Bay Area, where he's been covering technology news for more than two decades. Over the years his articles have appeared everywhere from CNN, MSNBC, and the Wall Street Journal Interactive...
Read more from David Cassel
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.