TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Google Coder Analyzes a Billion Files to Find a Winner in Tabs vs. Spaces Debate

21 pointsby palakzover 8 years ago

7 comments

Nursieover 8 years ago
&gt;&gt; Should you use the tab button or five spaces when you&#x27;re indenting source code?<p>Five? What sort of freak uses five?<p>And you should use the tab button, with your editor set up to insert <i>four</i> spaces instead of tab characters. This way display is consistent across editors, platforms etc etc<p>I must say I&#x27;m surprised at the result for &#x27;C&#x27; on there, as I&#x27;ve never worked with a C programmer that used tabs.
评论 #12403970 未加载
评论 #12404105 未加载
评论 #12404131 未加载
spepsover 8 years ago
I wish more projects would start using this : <a href="http:&#x2F;&#x2F;editorconfig.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;editorconfig.org&#x2F;</a><p>I don&#x27;t care whatever the original author of a project used, as long as my editor does the same automatically when I contribute.
Derpdiherpover 8 years ago
C++ Developer - must admit I used to use spaces, then switched to tabs.<p>This was for several reasons - firstly - makefiles will not be parsed correctly if you start using spaces rather than tabs, so it&#x27;s a good habit to get into to use them elsewhere to save headaches. Secondly, almost every developer I&#x27;ve met will want to use a different amount of spaces for indentation. When using tabs they can set whatever they want using the text editor or IDE of their choice.<p>This is my line of thinking anyway.
评论 #12407468 未加载
评论 #12403960 未加载
lolcover 8 years ago
The only reason I accept why spaces should be used is that people are unable to configure their editors apparently.
评论 #12407480 未加载
anotheryouover 8 years ago
It&#x27;s strange, that the white space in languages without &quot;meaningful white space&quot; has any impact after all.<p>Of course I like a blank line between blocks of more related functions, but I wonder why there is no standard for such things. Many text editors do the right step and auto-convert to your preferred spacing, but it&#x27;s still strange there is no standard for it.
dorianmover 8 years ago
It would be interesting to see if there is a trend on the spaces &#x2F; tabs per language statistics, and I would also be interested by the numbers of spaces per language.<p>e.g. I always use two spaces, but I mostly code in Ruby &#x2F; JS &#x2F; CoffeeScript. And that may influence my preference.
Binoover 8 years ago
And let&#x27;s assume most programmers don&#x27;t changes their editors auto-indent default. How does this affect the result?
评论 #12404191 未加载