TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

21 点作者 palakz超过 8 年前

7 条评论

Nursie超过 8 年前
&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 未加载
speps超过 8 年前
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.
Derpdiherp超过 8 年前
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 未加载
lolc超过 8 年前
The only reason I accept why spaces should be used is that people are unable to configure their editors apparently.
评论 #12407480 未加载
anotheryou超过 8 年前
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.
dorianm超过 8 年前
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.
Bino超过 8 年前
And let&#x27;s assume most programmers don&#x27;t changes their editors auto-indent default. How does this affect the result?
评论 #12404191 未加载