• each piece of code that I see with tabs has an implicit tabsize you really need to have if you don’t want the code to look ugly - especially if the person has been mixing tabs and spaces - and they usually do.

    Well written code doesn’t have an implicit tab size. You should be using a tab to mean “one indent” and if you need to align something an exact number of characters then use spaces.

    This is the downside to tabs, they are easier to use correctly. With spaces if it looks right in your editor it probably looks half decent everywhere else. Tabs have a worse behaviour if they are misused, but if used well then every viewer can view and edit with their preferred indent size.

    I wonder if it could be possible to adjust the “indent number of spaces you see” in code editors.

    You could potentially do a good job with a full parser for the language in question to determine the indent level and separate indent from alignment. But I’d rather not rely on this when we have a perfectly simple and semantic character for indicating what is an indent and what is an alignment.

    Maybe this could be a useful linter though. That way mistakes are caught but not every editor needs a perfect parser of every language.

    • The thing is - I have probably seen hundreds of projects that use tabs for indentation … and I’ve never seen a single one without tab errors. And that ignoring e.g. the fact that tabs break diffs or who knows how many other things.

      Using spaces doesn’t automatically mean a lack of errors but it’s clearly easy enough that it’s commonly achieved. The most common argument against spaces seems to boil down to “my editor inserts hard tabs and I don’t know how to configure it”.