Live data from Hacker News

The Tabs vs. Spaces war is over, and spaces have emerged victorious

xn--gckvb8fzb.com

121–130 of 238 posts

Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious

#124

Rob Pike on why Go is indented with tabs [0]: > How wide should the indentation be? 2 spaces? 4? 8? Something else? > By making the indent be a tab, you get to decide the answer to that question and everyone will see code indented as wide (or not) as they prefer. > In short, this is what the tab character is for. 0: https://groups.google.com/g/golang-nuts/c/iHGLTFalb54/m/zqMo...

Funny that the language famous for enforcing standard formatting allows freedom for this one particular thing.

Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious

#127

The point of the "tab" option is that there is no consensus on the number of spaces to use -- so by using tab, one uses a single character, and allows the developer to determine screen spacing to their comfort. "Tab" being a live option is a symptom of the war-never-over in absolute spacing degree -- since different people have different eye-sight, eye-strain, etc. constraints, different linguistic familiarities, cod…

But an editor can just as well let the user choose what width to display spaces at the start of a line. Nothing forces them to be the same width as spaces in the middle of a line.

which editor does that? space width is defined by the font, and normally you use monospace fonts. i am unfamiliar with any editor that allows you to choose a different font for spaces. besides, it would only work for indents, it would mess up any alignment of code into columns.

Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious

#128
post #85

In the 90s, when I used various text editors like Ultraedit, Nedit, Pico, Nano, Vi, and my co-workers used Dreamweaver, Visual C++, Visual Basic, NetBeans I was in the "TABs are superior" camp but only for the initial indention of code blocks. But somewhere along the way, editors added features that let you see invisibles, and let you set up smart tabs so that you could hit tab, but it would interpolate 4 spaces (or…

Navigation is still more painful with spaces than with tabs.

Not if you learn to use the right shortcuts for it (ctrl+arrows, mostly).

Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious

#129
post #43

Just define Tab as 1 space, and they can be used interchangeably. Peace in our time.

Why stop there? The tab nihilist would just define the tab to be 0 spaces. Then, tabs do not even matter

they still would in python.

Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious

#130
Meanwhile, the war on tab width marches on. Back when I got tired of inconsistent tab widths, I simply based my preference on the silly fact that some research showed how developers using two spaced tabs make slightly more money.

Among our team we do not enforce a specific width, but respecting the choice of the original author of a project is required.

Kind of annoying how LLMs will sometimes randomly decide to change tab width.

Post reply on HN