I know it’s a joke but I prefer the tab option. It’s easy to convert tabs to any particular spacing or code point width. It can also vary, if wanted, based on terminal or editor type.
People with worse eyesight can have a wider indentation while those who choose can opt for something more compact
Honestly I always preferred tabs for indentation and spaces for aligning. It doesn't break anyone's experience. And if somebody wants two spaces for a two-space-tab-width for indentation and other people prefer four. That will work just fine.
I hate seeing 2 space indents. Unreadable AF ( to me ). At least this way I can easily work in the same codebase without somebody being annoyed ( except for the crying about the tabs )
Why not tabs for both indentation and alignment? (Actually, I see indentation as just a specific use of alignment.) Word processors have been doing it for decades (and typewriters for over a century!). Surely we can convince our code processors to use user-definable, fixed position tabs instead of relative position "tab = x spaces".
Keeping the [TAB] character in the file then allows everyone the layout they like.
I can't imagine it would be difficult for an IDE to scale the width of spaces found at the start of a line, to emulate this same customization while still preserving my sanity as a fervent space-indenter. I've never seen an IDE that does this, but it'd be an interesting compromise.
It's not difficult at all, and many editors and IDEs already support this, making the entire point moot. Just do whatever the style guide says. I'm into PHP and Python so for me it's spaces all the way.
What if instead of having the IDE special case space characters at the start of a line, we had a special character that could represent a variable width space?
I agree, tabs are better but I have been using spaces for so long I can't even imagine switching to tabs. also I'd have to reformat all my abandoned projects.
Tabs are objectively the better choice as it allows each dev individually to decide tab width in their editors. Spaces in contrast don't allow this same flexibility as they are used for much more than simply indentation, for example you likely put a space after each argument or operator IE func(arg1, arg2) or 1 + 2.
Code can be viewed in more than just an editor. It might be in a terminal, rendered in a browser, etc. Sometimes you might even have to view it in an environment you don't control. I am very disinterested in configuring each and every tool to have sensible tabstops, if such a tool can even be configured.
Then don't? The whole reason nearly all the spaces guys do 4 spaces is cause that's the nearly universal tab width. You won't like this but the same exact argument can be made for spaces yet I'd bet you haven't even once configured the width of those.
I don't actually change tab width, it's the default 4 spaces equivalent for me but just because I don't take advantage of the ability doesn't mean I should prevent others from doing so.
After years of ass-whopping by python interpreter for stray tab characters, I'm now mentally rejecting the existence of tab character in my computing devices.
You're eating the onion. I could see some government agency deciding that they as an agency would standardize on tabs, though even that would be a stretch. But not the White House.
I actually does code a bit in phone(and only codes in phone) and still preffer tabs. Hate it when some editors auto spaceify it. Also you can have tabs on keyboard by installing abother keyboard app
That's one of the benefits of using tabs. Some people might like 4 spaces for indentation, whereas others like 2 spaces. If you use tabs, you can configure your editor to use whatever tab size you want, and they're just stored as tab characters in the file.
Tabs for indentation, spaces for alignment (eg for ASCII art).
That's why it's also a big accessibility feature. With big font sizes, four spaces are distracting but you can configure tabs to show up as one character, which is way more reasonable with font sizes larger than usual
I had a colleague that is legally blind in my second real job. The dude is brilliant (and hilarious) but these things would significantly enable or screw up his productivity. I have always felt fortunate to have had direct butt in seat exposure to the importance of accessibility at such a young age.