I have yet to see an editor that will truly work with spaces that way. Sure, the tab key will insert spaces, and the backspace will remove multiple spaces if you’re at a whitespace boundary, but I still have a much smaller click target when selecting the beginning of code (i.e. 1/4 the amount of space to click to get the cursor directly before the first non whitespace character, or when dragging to select the code on a line).
I always find that I’m clicking a bit too early in the “tab,” not selecting where I want, and then backspace is treating it like normal spaces again so things aren’t aligned.
I’d also love if it could render “tabs” of spaces at different widths, so that if one person wants to look at 2-space code, and another finds it more readable as 8-space, they have that option.
And anyway, all of this is only to help when a codebase is spaces when you want tabs, because I don’t see much benefit to saving out spaces if you’re going to go to all of this effort to emulate tab behavior.
While you can definitely get a speed up from going keyboard only and mastering hotkeys, you are way faster at selecting some random block of code with the pointer and retargeting to somewhere else to paste etc until you have them solid.
For everything I write, that marginal speed improvement isn’t even close to worth the learning cost of 100% ditching the mouse. I’m bottlenecked on deciding what I want to express, almost never how quickly I can enter it into the computer. I just want it to not be a “clunky” experience, i.e. once I decide to select a block of code to move it somewhere, I want that to be painless.
For that, tabs give a nice large margin for error on the click targets, which means I can move faster.
Edit: sorry someone else already said it in another part of the thread
The reason to use spaces is it keeps any alignment of multiline statements the same. You're not supposed to be able to adjust it because adjusting it means you can't do alignment, unless you use mixed tabs and spaces.
In my opinion, you can generally write very nice looking code even if the indentation of the multiline statement isn’t exactly matching the brace or whatever.
But as you say, you can still use spaces for alignment. I find it to be kinda meh because if the alignment has to change (like adding a longer variable name) you end up touching lines you didn’t otherwise have to in your diff.
Also, if we’re talking about editors doing nice things with tabs, I think you could make an editor look at the tab in and align things exactly how you want in rendering for a multiline statement.
I always find that I’m clicking a bit too early in the “tab,” not selecting where I want, and then backspace is treating it like normal spaces again so things aren’t aligned.
I’d also love if it could render “tabs” of spaces at different widths, so that if one person wants to look at 2-space code, and another finds it more readable as 8-space, they have that option.
And anyway, all of this is only to help when a codebase is spaces when you want tabs, because I don’t see much benefit to saving out spaces if you’re going to go to all of this effort to emulate tab behavior.