Hacker News new | ask | show | jobs
by joshstrange 712 days ago
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?

2 comments

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
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...