Live data from Hacker News

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

xn--gckvb8fzb.com

201–210 of 238 posts

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

#201

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…

The war is ending though. It will be over when we finally format code at read-time so that we respect the viewer's preferences, instead of at save-time to reflect the authors'.

Vertical spacing, ideally, reflects the thought process behind the construction of code: it's semantic.

Read-time revisions to spacing need, only, to change the non-intentional elements of spacing -- indent depth is a very good candidate for this (hence the tab character!).

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

#203
post #69

Earlier quoted context omitted.

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.

So are we also going to have team themes, team syntax highlighting colors, team fonts, team dark/light mode, team screen resolution, etc? Why not bikeshed the bikeshedding?

FWIW, team screen resolution is pretty much already there when the company provides the laptops (+ screens).

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

#204

The choice isn't (tabs) vs (spaces). It's (tabs && spaces) vs (spaces). In the real world, there will always be spaces, whether used for indentation or not. Using tabs for indentation inevitably leads to a mix of both - which is, objectively, worse for maintenance and consistency.

the correct rule is: tabs to indent, spaces to align [TAB][TAB][TAB]ShortTypename[SPACE][SPACE]variable_name [TAB][TAB][TAB]LongLongLongTypename[SPACE]variable_name2 ps. the [SPACE] counts above are illustrative, not accurate.

Just imagine pressing the space bar 12 times for each line, or having to use :vimq! to handle that without going crazy

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

#205
post #85

Earlier quoted context omitted.

Navigation is still more painful with spaces than with tabs.

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

You are pushing a lot of complexity to the editor here. Whereas with tabs you can uninstall a lot of garbage and link your keyboard directly with the binary representation of your code.

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

#206
post #138
post #109

Earlier quoted context omitted.

Stop aligning stuff. I don’t even use a monospaced font.

Yeah, let's just give up on readability

Alignment does not improve readability. Indentation is crucial, alignment is asinine.

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

#207
I would like to congratulate my fellow space using elite on our complete and total victory. I'm also now considering how to use the now empty spot in the ascii chart, I'm thinking we can use tab as an alternative pipe character as I'm tired of hunting for the existing pipe key with every friggin new keyboard I buy.

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

#208

Earlier quoted context omitted.

So are we also going to have team themes, team syntax highlighting colors, team fonts, team dark/light mode, team screen resolution, etc? Why not bikeshed the bikeshedding?

FWIW, team screen resolution is pretty much already there when the company provides the laptops (+ screens).

People run different UI zoom levels with modern laptops and (especially 4K) screens.

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

#209
post #136
post #104

Earlier quoted context omitted.

Sometimes I remember a workplace system I used, where someone had set tabs to 8 space. I don't know why it was 8, but it was.

It's how they've been interpreted forever on Unix and other old systems It's probably the main reason why they're so controversial.

Which was influenced by tab stops on typewriters... which were adjustable, but were generally set at 1/2", 3/4", or 1"... which was the equivalent to 5-12 characters, depending on your font (monospaced, but sometimes 10 cpi, sometimes 12 cpi).

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

#210

Completely agree: tabs FTW. I wish I could find the reference, but when dealing with mono-spaced fonts, readability is apparently enhanced with THREE spaces per indent. Now, good computer people hate non powers-of-two, so it's either 1, 2, 4, or 8 spaces!!!! I guess I'm not a good computer person, because my eyes find tab stops at '3 spaces per tab' just right.

TIL some people use 3 instead of a power of two. I would never had thought of it nor would I have considered it as a reasonable choice. And now I wonder why I would have thought that.
Post reply on HN