Hello guys. I built a simple voting app Tab vs Space.<p>I am using turso.tech (libsql) and Nuxt 3. I was planning to use websocket but it's just too complicated and just went with long-polling every 5 seconds to get the data and deploy it to cloudflare pages/worker.<p>There is no need to login and also no IP tracking. I use installation id and save it to cookies, so basically you can clear cookies to get a new installation id. I don't know a better way to get unique user without being "intrusive" but if you have a better idea please do give one.<p>You can check the source code here <a href="https://github.com/yunusefendi52/tab-vs-space">https://github.com/yunusefendi52/tab-vs-space</a><p>Thank you
I converted to Tabs after mainly switching from Python to Go. But even in Python I never pressed 8 or even 4 spaces!! (I used to press 2 spaces for an indentation in very early years, but I shortly switched to "tab to insert 4 spaces"). I think Tab is much more logical even for saving, because when you click on an empty space or move cursor with keyboard, your cursor never goes "between the lines". Even today most editors are not smart enough to fix this "between the lines" cursor problem.
If one represents a variable (tab) and the other represents a value (space), then what is the discussion even about? The whole idea of programming is to rewire your brain to be comfortable working with variables. Literally the first ever lesson is to consider that there is such a thing as $x. If we fully embrace that, then it is only logical to use tabs instead of spaces to ident the lines, as TAB character can be configured to be interpreted as many a spaces one wishes for.
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.<p>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).
Voting app just shows “Loading…” when I select an option then it goes away and nothing shows.<p>Tabs.<p>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.<p>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.<p>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.<p>I honestly don’t care about the file size difference but tabs win here as well.<p>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?
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:<p><pre><code> function stuff($a, $b, $c,
$d, $e, $f) {}</code></pre>
Well, the choice is obvious :)
I'm more surprised that HN doesn't have a filter for this kind of easy inflammable arguments, I know I have strong opinions about this issue; maybe we are getting better.
I categorize myself as a “don’t care, would use whatever the codebase is using”.<p>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.
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
I was actually converted to tabs after hearing Richard Hendricks' argument against spaces in Silicon Valley, the TV show. Really didn't think I was going to be challenging my own preferences when watching that show.