Live data from Hacker News

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

xn--gckvb8fzb.com

91–100 of 238 posts

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

#92

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.

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

#94

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…

One or two tabs though?! /s

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

#96
post #64

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…

I’d say that one’s approaching resolution, too. And 4 has won.

According to the table in the article there are more languages with a recommended value of 2 than languages with 4. I'm using 2 for Ruby and 4 for Python. I don't remember what I'm using for JavaScript, maybe the same value of the main language of the project.

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

#97
post #69

Earlier quoted context omitted.

> another developer is seeing the code different than you. but that's the whole damn point ... I like substantively indented code, you prefer minimally indented, we should both be happy (and we can be, by using tabs).

You could certainly make that argument. You could also make the argument that all the developers on a project seeing the same view of the code enhances collaboration and team cohesion, especially if your team does pair programming. This is often why dev teams have more specific style guides that include things would be considered bike-shedding, like how many spaces an indent is.

It seems that you don't understand what a tab character is ...

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

#98

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.

But don't fixed width fonts, which many consider the best for code, mean fixed width spaces too?

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

#99
post #5

Earlier quoted context omitted.

This works until someone tries to vertically align something like a table or a line that is wrapped.

That’s mostly editor braindamage (that has unfortunately leaked into some otherwise very good codebases, like LuaJIT). Indent things with tabs, align with spaces[1]: if (foo) { » frobnicate(bar, » ...........baz); } Both camps will hate you, but things will work just as they should. [1] https://www.emacswiki.org/emacs/SmartTabs

Actually for me this shows why tabs don’t deliver on their promise. As soon as the user’s tab size is small enough that baz doesn’t need to wrap, the user gets suboptimal formatting. As someone who prefers tabs of 2 and often views code authored with tabs of 4 I encounter this often.
Post reply on HN