to each their own, but I will counter by saying I find spaces to be much better suited for aligning multi-line statements and, ironically, tabular data
I credit yaml for making me get over my distaste for JSON, because unlike yaml every programming language already comprehends JSON without requiring a module.
Use what you like. I don't use tabs but that's the way I've always done things. I use spaces. But I'm somewhat of a purist in terms of code. I always try to make my code look appealing to the eye, even though nobody sees it.
Oh believe me, I know. I like to use 5 because that's comfortable for me. It was just disturbing to see crap like that. Braces on same vs next line, wrapping long calls vs breaks, just asinine stuff. Like it was a personal affront to do it any other way.
Didn't have a profile photo on Twitter for 12 years. I was just considering adding one this month, but I couldn't decide on any. So, it's way to early to add one here. Maybe in 20 years or so.
they're accessible compared to spaces because the amount of space they take up can be adjusted per person, so you don't have to worry about people using 2 space or 4 spaces because tabs can be viewed as whatever number of spaces you want
always thought you could just set up your editor to recognize leading spaces and space those how you want, but I haven't seen any editor do this... like s/^ /\t/
I mean, we all *type* a tab key, right? Regardless of the output.
And most modern editors are able to detect the tab-length, even if spaces are used. I don’t even think about it anymore.
That said, tabs are able to change their displayed length dynamically, so I might try that.
yea I rarely even manually type out tabs or spaces anymore because I have auto-formatters on save that'll put in all the indentation for me
might be more necessary to manually do it for languages like python where indentation does change how the code functions rather than just being aesthetic
I don't have any issues with using either spaces or tabs. Whatever the lead developer is using I guess. And if it's my project, I'll just end up using whatever is my current editor's default.
I've been a developer professionally since 1999 using Solaris UNIX, then RHEL
I use GUI on desktop and nano in the shell because coding is in VS Code, a text editor isn't where I pretend to run the world, and the vi vs. emacs thing is for grognards
*fellow vim user swooping in*
The worst thing in vim is feature discoverability. I used to code in IDEs with oodles of plugins, believing that Vim couldn't possibly do even half of what my IDE could. I now know it's the other way around.
The main arguments for spaces is the consistency. Different platforms and editors display tabs with varying sizes. Since they are configurable, there is no guarantee that the code you’ve written will be read the same way.
people who need more/less indentation are able to customize how their tab indents are sized for accessibility, while with spaces you're locked in to the preference of the code owner
If everyone is using the same editor and configs then tabs work fine. When, Harry, new guy is hired the code becomes all janky and hard to follow, especially if using a different font.
Do you think people using spaces just mash the space bar 50 times? The character being inserted is what is being debated. Everyone still presses the tab key on their keyboard.
Comments
Always make sure the default setting is NOT to turn them into spaces. 😎
I don't even know why they care so much!
tabs allow people to customize their IDE to show them as 2, 4, even 8 spaces wide if they really want to
Sorry, guess I just was bothered by it.
javascript, python, json = spaces
sql, java, c# = tabs
I've just started using tabs for my own personal projects in case someone needs customizable tab spacing for accessibility to read my code
that's twitter level thinking
get that outta here
we love trans rights 🏳️⚧️ in this house
And most modern editors are able to detect the tab-length, even if spaces are used. I don’t even think about it anymore.
That said, tabs are able to change their displayed length dynamically, so I might try that.
might be more necessary to manually do it for languages like python where indentation does change how the code functions rather than just being aesthetic
We shouldn’t be storing code as plain text. That’s the mistake.
Display preferences should be just that—display. They shouldn’t be inline with the content.
most people don't post here for follows
and engagement farmers tend to be chased out due to the culture here
I use GUI on desktop and nano in the shell because coding is in VS Code, a text editor isn't where I pretend to run the world, and the vi vs. emacs thing is for grognards
The worst thing in vim is feature discoverability. I used to code in IDEs with oodles of plugins, believing that Vim couldn't possibly do even half of what my IDE could. I now know it's the other way around.
people who need more/less indentation are able to customize how their tab indents are sized for accessibility, while with spaces you're locked in to the preference of the code owner
If everyone is using the same editor and configs then tabs work fine. When, Harry, new guy is hired the code becomes all janky and hard to follow, especially if using a different font.