Live data from Hacker News

Show HN: Tab vs. Space, vote for your empty space

tab-vs-space.pages.dev

11–19 of 19 posts

Re: Show HN: Tab vs. Space, vote for your empty space

#11
Voting app just shows “Loading…” when I select an option then it goes away and nothing shows.

Tabs.

Tabs let people make the indention level (2 or 4, or 8 for monsters) whatever they want. If you want tighter code you can make it 2 spaces, if you want to “space” things out you can go with 4.

Spaces make it way too easy to accidentally insert +/-1 space by accident. Now your indention is 1 or 3 spaces instead of 2 or 4.

Spaces encourage/allow non-standard indention for aesthetic reasons. It’s just too easy to say “well if I use 3 spaces here everything will line up nicely”. You hand yourself a massive footgun when you have spaces at your disposal to (ab)use.

I honestly don’t care about the file size difference but tabs win here as well.

Indention is important, in some languages it’s mandatory (looking at you Python) so why would you use anything but a special character to signify it? Why would you not use a flexible character that can be rendered according to a developer’s preference?

Re: Show HN: Tab vs. Space, vote for your empty space

#14

Voting app just shows “Loading…” when I select an option then it goes away and nothing shows. Tabs. Tabs let people make the indention level (2 or 4, or 8 for monsters) whatever they want. If you want tighter code you can make it 2 spaces, if you want to “space” things out you can go with 4. Spaces make it way too easy to accidentally insert +/-1 space by accident. Now your indention is 1 or 3 spaces instead of 2 or…

Database is down. There was some bots voted every seconds. I added Turnstile 5 hours ago but it was already too late. Sorry for the inconvenience, still looking for the solution

Re: Show HN: Tab vs. Space, vote for your empty space

#15

Voting app just shows “Loading…” when I select an option then it goes away and nothing shows. Tabs. Tabs let people make the indention level (2 or 4, or 8 for monsters) whatever they want. If you want tighter code you can make it 2 spaces, if you want to “space” things out you can go with 4. Spaces make it way too easy to accidentally insert +/-1 space by accident. Now your indention is 1 or 3 spaces instead of 2 or…

Linus must be quite the monster!

> Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.

https://www.kernel.org/doc/html/v4.10/process/coding-style.h...

Re: Show HN: Tab vs. Space, vote for your empty space

#16
I categorize myself as a “don’t care, would use whatever the codebase is using”.

But I realize now that I rarely press tab or space when I indent. I find that most of the time, I am either leveraging auto indent, or using vim’s/IdeaVim’s >> and << commands to indent. At this point, I honestly have no idea if I’ve been using tabs or spaces in the last 6 or so years.

Re: Show HN: Tab vs. Space, vote for your empty space

#17
Tabs - it's an accessibility feature. Even with large font sizes I have trouble reading code that's indented with 2 spaces, and 8 is just unreadably wide.

This isn't word processing - everyone's IDE or environment is going to be different, from colour scheme to syntax highlighting to font size to font to line spacing to monitor DPI. Get over it and use tabs - you will not control how code looks on my screen(s).

Re: Show HN: Tab vs. Space, vote for your empty space

#18
Tabs. When you use tabs, indentation and spacing has to really make sense (like no parens/brackets on a line by itself unless indented). For example, with spaces, you may end up with this monster; and with tabs, it is nonsensical:

    function stuff($a, $b, $c,
                   $d, $e, $f) {}

Re: Show HN: Tab vs. Space, vote for your empty space

#19

Database is down, it's exceeded the free threshold because there was some bots (exceeded 4 billion read). I added Turnstile around 5 hours ago but I think it was already too late. Sorry for the inconvenience

Sorry everyone. I've been running out of free threshold both cloudflare and turso.tech so I am taking down the website. You can access the source code in github if you curious. Next time I think I should disable SSR and add Turnstile to avoid bots. Thank you.
Post reply on HN