So even though in most cases those three uses for tabs are independent, in some languages they get muddled. F# is another language where you may want to align text on line two with the middle of line one, e.g. if you write
let person = { FirstName = "Bill"
LastName = "Gates" }
Now, that's considered bad style according to https://learn.microsoft.com/en-us/dotnet/fsharp/style-guide/... — and they're entirely write to recommend against that style — but it's legal syntax. And it's probably why https://learn.microsoft.com/en-us/dotnet/fsharp/style-guide/... forbids tab characters entirely in F# code.(Those two links point to different anchors in the same document, BTW: the HN link shortening is going to make them look identical until you hover over them).
var result = someObject.SomeMethod(param1, param2,
param3, param4);
And then to my horror I noticed that the editor (earlier I said it was VS Code, but thinking back I think it was actually Visual Studio) had produced this monstrosity: var result = someObject.SomeMethod(param1, param2,
<tab><tab><tab><tab><tab><tab><tab>param3, param4);
(Actual number of tabs was different, of course, and I believe it was followed at the end by a space or two, whereas my example happened to line up without needing an extra space character).I know not to do that. The editor did it anyway, and if I hadn't been paying close attention to whitespace I might not have caught it.
The editor could have been smart enough to parse the code into an AST, notice that param3 and param4 were part of a parameter group, and said "I will use tab characters equal to the indentation of `var result`, then spaces thereafter". It didn't. I had to edit the call to look like this:
var result = someObject.SomeMethod(
param1, param2, param3, param4
);
And then I was safe from the editor trying to align things with tab characters.If my memory is right about which office I was working in when I saw the editor do that to my code, then it was more than a decade ago, probably around 2010 or 2011. It's possible that the modern version of that editor has improved its handling, and would have correctly aligned param3 with spaces. I haven't checked recently. Maybe at some point I will, and report my findings.