3 ms·
Because redefining tab width as something other than 8 is, quite frankly, a disaster. The problem is, a "tab" does not advance by 8 spaces; it advances to the
by pjkundert 15y ago
Because redefining tab width as something other than 8 is, quite frankly, a disaster.
The problem is, a "tab" does not advance by 8 spaces; it advances to the next column divisible by 8! Shockingly, most editor writers don't seem to realize this; this appears to be especially true in the Windows world (perhaps because they never used typewriters or ASCII terminals?)
The resultant code is only readable in an editor with the same settings; for a language like Python, the resultant code will, in fact, be semantically incorrect.
Some editors that are not broken (eg. emacs, vim), allow you to specify a desired indentation level, and then the editor constructs the correct combination of tabs and spaces (ideally just spaces, for Python) to indent the code to the correct depth.
This comes from someone who has to regularly recover code mangled by dozens of Windows "programmers" who edit code on so-called "Programmers" editors with alternate tab settings...