Jeff Vinnick / Stringer / Getty Images
- Bill Gates prefers using tabs to spaces when he programs.
- Tabs vs. spaces is one of the most popular and enduring debates among programmers.
- Recent research indicates spaces might actually be more popular - and, oddly, more lucrative.
Bill Gates on Tuesday weighed in on the long-lasting debate over the best way to format software code.
For the record, the Microsoft cofounder is a tabs guy. That's sure to annoy the other side of the debate - the advocates of spaces.
"When I code I use tabs because you want the columns to line up," Gates said in his annual Reddit AMA (Ask Me Anything) session. "For some Word documents I use tabs. You want things to adjust when you go back and edit them, and tabs help."
Tabs fans cheered having one of the most famous coders on their side. At the time of writing, Gates' answer had almost 14,000 "upvotes," making it one of the most popular posts in his AMA session.
The debate over tabs and spaces has raged for years. At stake is the aesthetics of code - what it actually looks like when it's examined line by line.
Advocates of tabs argue that putting one after each new line makes code more readable. Spaces fans say pushing the space bar a few times instead offers a more flexible layout.
Despite all the "upvotes" on Gates' post, he and fellow tabs fans may actually be in the minority.
In 2016, a Google research analyzed a billion files across 14 terabytes of data and found that in almost every programming language developers used spaces far more often than tabs. Meanwhile, a study last year found developers who use spaces get paid more than those who use tabs.
The whole tabs vs. spaces debate is so well-known and widespread that it was memorably lampooned in a 2016 episode of HBO's "Silicon Valley" in which Richard Hendricks ended his relationship with a Facebook engineer over her programming style.
That scene is below:
Get the latest Microsoft stock price here.