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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Tabs are objectively better than spaces

17 点作者 gilcot超过 1 年前

6 条评论

scrungiforous超过 1 年前
Tabs are controlled by the renderer and can look wholly different per IDE&#x2F;notepad<p>Monospace spaces are consistent across every machine<p>While the fight over &quot;how many spaces&quot; can be tricky, at least the code looks consistent once a standard is found
评论 #37622739 未加载
deafpolygon超过 1 年前
I have always loved tabs, but the general consensus and insistence that Spaces are the Way(tm) has made me switch begrudgingly because I want to be a good team player.<p>I love that I can set tabs to a certain size and it all just works. Nowadays I have to use an editor that already has spaces in mind just to edit. I used to be able to edit code in Notepad, but with some codebases using 2 spaces, or 4 spaces... I&#x27;ve even seen some with 8 (!!).. I have to use an editor that understands spaces = tabs (VS Code, for example).<p>There are days when I want to switch sizes, just because of my little neurodivergent brain.<p>I&#x27;d love to hear why spaces became the dominant form of indenting code. Does anyone know the history?
评论 #37621284 未加载
评论 #37621280 未加载
评论 #37621344 未加载
评论 #37623028 未加载
lordkrandel超过 1 年前
I have ADHD and letting ppl define how much indent they have equals to not having a standard. Some will choose 3 and you will curse them for life. 4 spaces is the only way, rest sbould be burnt in hell.
评论 #37623416 未加载
Rygian超过 1 年前
Betamax was also objectively better than VHS.<p>There is added value to collectively agreeing on one format. I think that added value can easily outperform the technical merits of a specific format.
评论 #37641578 未加载
karmakaze超过 1 年前
For python, I&#x27;d say spaces are objectively better than tabs.
评论 #37623684 未加载
beart超过 1 年前
Use an autoformatter with formatting rules defined and committed with the code so your team never has to argue about code style again. It shouldn&#x27;t even be possible for that to come up in code review since it should be an automated check.