It's very hard for me to accidentally indent with 3 spaces. Pressing tab always inserts the amount of spaces needed for the next indentation level. Pressing backspace always removes spaces to go back a level.
For example, at 0 spaces, tab will insert 4. If I add 1 more by pressing spacebar once, then press tab or backspace, it will add or remove 3 or 1 spaces respectively.
Extremely complex behavior for something that is inherently supported by the text renderer via the tab character. Tabs will also automatically order according to column completely automatically, spaces will not. Spaces-for-tab is a cargo cult. An extremely popular one, but a cargo-cult nonetheless. I mean, how many people who defend spaces actually know the history of representing tabs as spaces? Because it used to be useful once upon a time, when people tended to be more prone to printing out code to paper on matrix printers. Hint : a long-forgotten era of programming.
What if I want to indent my Lisp with 2 spaces, Python with 4, and C with 8, and have it look the same for everyone else looking at my code? Not every editor can do this with tabs seamlessly, and even then some people might use different settings. Also how would you configure this in a browser or terminal?
14
u/nandryshak Sep 03 '17
This seems like a problem that is easily solved by using a properly configured editor.