• Tabs let you define how big you want each indent to be

    …except when they don’t. Many common environments have a hardcoded tab size of 8, which is insanely big for using it for indentation.

    • Because other people might have restricted environment which might not suit their preference is not a good reason to level it down IMO.

      Also, I think 9 is the best size for indent (matter of preference), do you think I should switch to space so everyone can enjoy this wonderful view I have ?

    • What environment are you using that has a hardcoded tab size? I haven’t seen this since typewriters.

      Some projects just use tabs as a compressed form of 8 spaces. But that is a sin. Use tab to mean “one indent level” and align with spaces if you need to. (the occasional ASCII art diagram)

        •  kevincox   ( @kevincox@lemmy.ml ) 
          link
          fedilink
          9
          edit-2
          10 months ago

          Termux

          I think running tabs -N (where N is you preferred tab size) in the terminal should work. This is what I use in my zshrc on desktop.

          SourceHut

          Yup, they seem to be pretty opinionated here. If you look at the source there is just an inlined style with a single rule pre { tab-size: 8 }. I guess that is what you get when you use opinionated tools. The user’s browser isn’t right, my preference is right!

          “View page source” in the browser

          On Firefox this uses my default tab size of 4. But I guess changing this default isn’t user-friendly.

            • I don’t understand what you are trying to say. I agree that SourceHut forcing their preference isn’t good. The other two are configurable and I have configured them to my preference on my machines.

              • I agree that SourceHut forcing their preference isn’t good.

                I don’t think this is a fair point. Every developer makes “opinionated” decisions on default settings on a daily basis. SourceHut is open source and anyone can propose a patch that makes the tab width configurable, which to my knowledge has not happened. “Forcing their preferences” would imo imply that this discussion happened and the patch was rejected without good reason.

                To me, this sounds a lot like the usual “I don’t like the how this thing that you provide for me for free is doing this one thing so I demand you change it for me free of charge” argument.

    • This is the biggest problem with tabs. Too many tools don’t let you adjust the size (or make it very difficult). This is the only reason I usually prefer spaces (only very slightly).

      My dream solution is elastic tabstops and I’ve posted about it here before a few months ago. The problem with wanting elastic tabstops is that it seriously compounds the issue of “editors don’t properly support it”

      https://nickgravgaard.com/elastic-tabstops/

    • As an embedded software developer that does linux kernel drivers I’ve come to love the tab size 8 indentation level.

      I’m paraphrasing: “if your indentation level gets too deep, it’s time to rethink/refactor your function.”

      And with tab 8 you’ll notice it rather quick if your function does too much/unrelated stuff.

      A function should be short and do one thing only, if possible. It also makes unit testing easier if that’s a requirement.

        • Oh, I’ve done my fair share of C++ and Python as well. But you got to agree with me that when you are on your fourth indented “if case” it’s time to step back and think about what you are trying to achieve. I mean it’s probably going to work, but probably also very hard to maintain that type of code.

                •  JesperZ   ( @JesperZ@programming.dev ) 
                  cake
                  link
                  fedilink
                  2
                  edit-2
                  10 months ago

                  There a many ways to implement abstractions, but it’s highly dependent on the language in question. You could simply refactor each level of nesting into its own function, with all dependents provided as parameters instead of scoped variables. You could then flatMap to avoid a bunch of nested looping, favoring a linear approach that’s often easier to reason about. You could go all out and refactor all your conditional statements away, in favor of the Either monad. You’d then have a number of functions, each doing one thing (including no nesting), and a main function gluing it all together, linearly. That is a pattern you can always apply; there’s nothing controversial about it, and on a similar note there’s nothing particularly challenging about Gaussian elimination.

        •  realharo   ( @realharo@lemm.ee ) 
          link
          fedilink
          11
          edit-2
          10 months ago

          Not like that, lol

          Just saying, instead of this monstrosity

          CreateOrderRequest(user,
                             productDetails,
                             pricingCalculator,
                             order => order.internalNumber)
          

          Just use

          CreateOrderRequest(
              user,
              ...
          

          Putting the first argument on a separate line.

          Same if you have an if using a bunch of and (one condition per line, first one on a new line instead of same line as the if) and similar situations.

    • Then you lose the benefit of tabs: you can’t adjust the tab width without destroying alignment. So you end up with a confusing mix of characters for no benefit.

      Mixing them is the worst option.

      •  Faresh   ( @Faresh@lemmy.ml ) 
        link
        fedilink
        English
        5
        edit-2
        10 months ago

        The opposite is true, though. If you use tabs for indentation and spaces for alignment, you can adjust the tab width without destroying alignment. That’s the big benefit of the tabs-for-indentation-spaces-for-alignment mix.

        You can’t do that with only tab characters, you can’t even align stuff with tabs because it has variable width.

      • You might not understand how to do it properly so here’s the idea:

        Tabs will let you reach the indentation level of the current block, then from here, you’ll use spaces to align stuff property. Here’s an example, where >••• are tabs (I’m exaggerating alignment for the sake of the example) :

        >•••if (condition1 == true
        >••• || condition2 != false)
        >•••{
        >•••>•••struct ident people[] = [
        >•••>•••>•••{
        >•••>•••>•••>•••.name   = "bob",
        >•••>•••>•••>•••.pubkey = "value1",
        >•••>•••>•••},
        >•••>•••>•••{
        >•••>•••>•••>•••.name   = "alice",
        >•••>•••>•••>•••.pubkey = "value2",
        >•••>•••>•••}
        >•••>•••];
        >•••>•••secureConnection(people[0].name, people[0].pubkey,
        >•••>•••                 people[1].name, people[1].pubkey,
        >•••>•••                 CRYPTO_ALGO_DEFAULT);
        >•••}
        

        As you can see, everything will stay correctly aligned as long as it’s within the same block.

      • You’re confusing using tabs for indentation and spaces for alignment with using tabs and spaces for indentation. This means each line starts with tabs. Next you optionally have spaces for alignment with previous lines. Then you have content (like code or comments). Because you never have a tab following a space the alignment is never destroyed by adjusting how wide a tabstop is.

    • I used to think this way, at least when writing C++. But it’s objectively harder to do and convince other people to follow, especially if they can’t be bothered to change their environment to display tabs and spaces differently. It’s a losing battle so now I just do spaces when working with other people

    • It’s hard to do this consistently (especially in a team) because people might (and statistically in a large enough project, will) use the tab key for alignment since it’s faster than pressing space, or just be confused about what whitespace is tabs and what is space. Just using space everywhere is idiot proof and requires no work to micromanage. The only way to use tabs is to not align at all.

      • I agree that it’s hard, but not impossible. This usually boils down to how Nazi people are when merging code. In a corporate environment, nobody gives a damn so yeah you gotta use whatever you want because there are already different indentation systems within the same file anyway :)

        But hey, you gotta live by the changes you want to see happen, so I personally put a lot of effort in formatting my code regardless.

  •  eee   ( @eee@lemm.ee ) 
    link
    fedilink
    2910 months ago

    Neither tabs or spaces are good. The correct way is to leave no whitespace in the code at all. It’s unnecessary and adds to processing time.

    Everyone should aim for 1LOC per commit

  • Another accessibility reason for tabs: when using a braille display, each space takes up one character cell, so indenting with four spaces eats up four cells. Indenting three times with four spaces each eats up 12 characters already. Tabs only take one character cell each, so three indents = three character cells used.

    The fact that there (I assume?) isn’t a braille oriented text editor that can handle space-based indentation in a smarter way is a bit depressing. Maybe the solution should be better tools based around accessibility rather than convincing everyone to switch to tabs, which is a project that will just never succeed.

    • So your fix is “convince all the people that want/need the better handling to use a specific editor?” - perhaps it’s a smaller number of people, but do you not see the irony there?

      I honestly don’t care about tabs vs. spaces, but if there’s a low cost change in my setup that makes it easier on others, why not?

      • My spontaneous reaction is that making some sort of braille oriented setting for some or hopefully most editors used by people with braille displays (I have no idea if using a “normal” editor even makes sense if you’re using a braille display) is the most pragmatic solution to their screens being taking up by spaces.

        First of all, convincing everyone to use tabs is a monumental task. Convincing people with braille displays to use more convenient tools on the other hand seems pretty easy, why wouldn’t you want to use more convenient tools?

        Secondly, there is a large amount of code written with spaces today, so even if people switch with tabs in the future you might still want to be able to read legacy code.

        Thirdly, I don’t think that the choice of tabs vs. spaces is completely arbitrary because of alignment. Using tabs for indentation and space for alignment leads to a lot more micro management of whitespace compared to just using spaces. I would guess that alignment isn’t very braille friendly anyway, but it does make the code more readable for other people. Having a good braille editor affordance might be closer to letting us have our cake and eat it too.

        Of course, I don’t know what this would look like exactly, and maybe there’s some sort of obstacle that I’m overlooking, I do want to be clear that this is just of the top of my head as someone who has never used a braille display.

        • There’s a difference between doing something that’s “easier” and what’s right.

          Whether there is more legacy code with spaces or tabs is irrelevant. Most of the code that will be written hasn’t been written yet.

          I disagree with you on “micromanagement” of spaces vs. tabs, that is nonsense. Set up a formatter for commits and set your IDE to display how you want.

          The pragmatic view on one or the other is that for a one group of people, using tabs appears to be significantly better, and for everyone else, it barely matters at all, except as personal preference.

          That being said, I’m not vision impaired, so I don’t know what the preference would be.

          The reason we’re even talking about it is that someone that has studied it from an accessibility perspective has asserted that tabs would be preferred.

          • There’s a difference between doing something that’s “easier” and what’s right.

            The way I see it, there are two competing strategies for improving the experience for braille screen users: making tabs more widely used and improving braille oriented editors. Without knowing for sure, my guess is that improving editors is a better strategy and this is in part because it is easier.

            As a matter of principle it might be “more right” for people without visual disabilities to adjust themselves to people with visual disabilities than vice versa, but I also think that it’s important to care about what is actually likely to improve braille screen users experience and not default to the more principled goal without any consideration for how realistic it is.

            (Of course, I might be overestimating how easy it is to get better braille oriented editors, but since you referred to this as the “easy” solution it doesn’t sound like you’re disputing this specifically.)

            • Let’s agree that we aren’t going to affect this change in this comment thread, so which one is more “pragmatic” is beside the point.

              What does matter is whether we decide to have an inclusive view on this issue, and are willing to make extremely minor modifications to our settings and workflows to be more accommodating for others.

              I am encountering more and more cases where people behave in inexplicably selfish ways, and this just feels like another one. It’s low/no-cost to do, yet could yield benefits to others. Low cost/risk, high potential reward.

              Starting with “we’re not going to even consider raising awareness and let the market decide” is just a very cynical way to approach the world, and I’d argue is even actively harmful to the people that hold that view.

              • Do you think it matters if getting a large number of people to switch to tabs is an achievable project at all? Maybe I am a bit cynical but this seems to me like something that is actually very difficult to do.

                When faced with a problem like this I think it makes more sense to approach it from a perspective of what would be a practical way to actually address it and refusing to do that does I think in its own way betray a different kind of cynicism.

                For the record what I’m saying isn’t that I wouldn’t switch to tabs for the sake of people with various disabilities, I’m saying that spaces are slightly better than tabs if you don’t have any relevant disabilities so if there is a way to have the cake and eat it to that would be a nice bonus, but that’s honestly besides the point.

                • You are treating this as a binary/zero-sum game. Will we get to 100% use of tabs (or spaces)? No. Will we get a “perfect” viewer made and then adopted by all visually-impaired people? No. Making people aware that a fairly mundane choice has a negative impact on others might change their behavior, or at least challenge it.

                  Change like this is incremental, so just having the conversation, and asking you to consider that making a small change to your config might help some people down stream is something. Asking you to bring this point to the next conversation about tabs vs. spaces, is helpful.

                  I’m saying that spaces are slightly better than tabs if you don’t have any relevant disabilities

                  This is my fundamental issue with your original statements, and this thread: It’s a subjective choice that you think is slightly better than removing a barrier/major annoyance for an entire group of people that may want or need to interact with your code. It’s closing the door on possibility for a minor personal preference.

            •  TheCee   ( @TheCee@programming.dev ) 
              link
              fedilink
              English
              310 months ago

              Of course, I might be overestimating how easy it is to get better braille oriented editors

              A braille display traditionally is a personal, almost handfitted (estimated by price) device controlled by its screen reader software. Not the editor. This has some unfortunate implications:

              • There is no (standardized) API to control your braille device directly. You could hand your screenreader filtered data, but that would be read as well. At best, you might be able to script your screen reader software to a varying degree of success. However:
                • Every aspect about this is extremely abysmal in every possible way, so it will likely require you to fork over some biiiiig amount of cash to one of the vendors to provide a brittle plugin. In particular if we are talking about JAWS. Think of extremely unstandardized COBOL dev with less stability and more price gauging involved.
                • As far as free readers are involved, only the proprietary and licensing aspect go away. Still, developing extensions is terrible in many ways. For example, for ORCA, I was able to find out that you can extend it somehow. Alledgedly. NVDA on the other hand has better documentation. That is to say, it has documentation. Now, you might recall that NVDA is written mostly in Python, and its devs rightly don’t even pretend that one could develop stable software in Python, so APIs might change. However, I wasn’t able to find a Filter function specific to braille output. That’s likely because
              • From my superficial experience, developers of screen readers think of braille displays mostly as an alternative to speech. It even took them quite a while to be smart about not displaying redundant, long lines of text.

              So yes, you might be overestimating how easy that is, compared to telling some diva asswipe chucklefuck to use that formatter or work at McDolans.

                • I sure hope so, but I’m not overly optimistic tbh. The market is basically considered medical, therapeutic devices. It is as you imagine, probably worse. It isn’t easy to find prices directly, but the only way this range of vendors continues to exist in this niche market is to sell devices with the complexity of a keyboard for four to five digits. There is no competition worth talking about happening.

                  So unless very specific regulation takes place, I don’t see standardized access to braille displays happening.

    • rather than convincing everyone to switch to tabs, which is a project that will just never succeed.

      Few years back, Coraline Ada Ehmke went on a one person crusade opening a pull request on every major Github repository to adopt a code of conduct for the project, detailing the complex rules of how the humans in that microcosm of a project should interact with one another. Today, it’s the norm.

      Arguing that it’s invincible to convince people at large to adopt tabs over spaces with good arguments is a ridiculous statement. All you are doing is making up excuses for not having to care.

      • Arguing that it’s invincible to convince people at large to adopt tabs over spaces with good arguments is a ridiculous statement

        I do actually think that it is very hard to convince basically every programmer of something, no matter how good arguments you have.

        Also, without knowing much about the issue, it sounds a bit like the tooling for people using braille displays isn’t very good and fixing that is maybe also worth advocating for, perhaps it’s even a strategy for advocacy that is more effective?

      • That reminds me of those times when back on reddit some dev showed up to present their new GUI library. Bragging about how they were better than Qt devs etc. (even though they didn’t implement the hard parts, like working text fields or tables)

        After some time a bunch of people had enough and started bullying those guys into submission about accessibility. After some time, every of those toolkits had support or at least plans for supporting screenreaders. Eventually, AccessKit became a thing.

        Good times.

  •  Kissaki   ( @Kissaki@feddit.de ) 
    link
    fedilink
    English
    2310 months ago

    I consider tabs for indentation a failed concept.

    The idea is good, but it evidently failed. Most guidelines and newer Tools recommend or require or use spaces for indent. They have their reasons too.

    The prevalence of spaces makes it hard to make a contrary argument for tabs. By now, I don’t think it’s worth even if it had reasonable advantages.

    Editors/IDEs that parse syntax can adjust space indent too. A mixture for indent and alignment is not obvious for everyone (I always display whitespace in my editors and am deliberate and consistent, but many people and editor defaults won’t be). Some defaults of four or eight space-width tab display is atrociously wasteful and inaccessible.

    Spaces are a good enough baseline. It works well enough. And most importantly it works consistently. That’s why it won in prevalence and use.

    • It works well enough

      is an argument that works for you because you have somewhat healthy eyesight (not counting common glasses).

      It “won” because the majority of healthy people has no problem marginalizing minorities with disabilities.

      •  Kissaki   ( @Kissaki@feddit.de ) 
        link
        fedilink
        English
        4
        edit-2
        10 months ago

        Do you have actual experience with it?

        Some time ago I read a comment from someone with impaired eyesight who used an editor that would adjust space indent just fine.

        Accessibility is a thing I always consider.

        • Not personally, but I had a co-worker once who had an eye condition that made him extremely short sighted to the point where glasses could not fully correct it. He walked around in public using a stick for safety.

          For his work, this meant he had to apply an extremely large front sizes. Since out code base was space indented, in nested places this would result in almost half his screen being blank on the left side because of the space taken to render blanks.

          Sure, we could have just stood out ground and let him solve his own problems somehow. Instead, we made one change to the editorconfig, ran the formatter for a second, he set his tab width to 1 and the world was marginally better for him in less time than it takes me to tipe this text on my phone.

          •  Kissaki   ( @Kissaki@feddit.de ) 
            link
            fedilink
            English
            1
            edit-2
            10 months ago

            I would have preferred tabs to win for this reason.

            Unfortunately, as you pointed out, “good enough” can be excluding, non-inclusive. Overall it works well enough for enough people / none with impairment stumbled over it yet, did not voice or were not heard.

            the majority of healthy people has no problem marginalizing minorities with disabilities

            I wouldn’t attribute malice like this though. Most people just don’t care or are not mindful and thorough.

    • If I could only get everyone who works on the thing I work on to use a whitespace visualizer, it would be enough. We can fight about tabs or spaces after we get rid of all the unnecessary trailing ones.

      •  Kissaki   ( @Kissaki@feddit.de ) 
        link
        fedilink
        English
        110 months ago

        I created a tool for removing trailing whitespace across the whole project. After cleanup now it’s at least only a matter of pointing it out in reviews and occasionally fixing landed sources.

  • I’ve always wondered why some people tout “forcing a consistent appearance across environments” as a pro for spaces. That’s a bad thing.

    To be honest I’m surprised code format converters aren’t ubiquitous. Let the repo have it’s master format, enforced on commit. Then converters translate into each developer’s preferred standard dialect on checkout and back again on commit.

    • The consistent appearance thing is probably more about how mixing tabs (for indentation) and spaces (for alignment, eg in multi-line function definitions of calls) looks like complete crap if you change the tab width.

      •  JackbyDev   ( @JackbyDev@programming.dev ) 
        link
        fedilink
        English
        6
        edit-2
        10 months ago

        Using only tabs for indentation and only spaces for alignment will never result in crap alignment when adjusting tabstops because the alignment does not use tabs.

        This is using both tabs and spaces for alignment.

        --->func foo(int i,
        --->--->     int j);
        

        Observe what adjusting the tabs does,

        ->func foo(int i,
        ->->     int j);
        

        This uses only spaces for alignment,

        --->func foo(int i,
        --->         int j);
        

        When converted the alignment is maintained because the tabstops aren’t used for alignment, only for indentation.

        ->func foo(int i,
        ->         int j);
        
      • I think you have it backwards. If you use tabs for indentation and spaces for alignment it works great for any tab size.

        It is when you use a tab just as a compressed representation of 8 spaces and use them for alignment as well that it goes to shit. (because you have made the sin of tab == 8 spaces instead of the correct tab = 1 indent level)

        • How does that work, and with which editor settings? If you simply set the tab width (tabstop) in vim, things go south.

          Say you have a function definition one indent level in, then 22 characters of text. You more want to align the next line to that. How does that work in practice with tabs?

          The obvious way with tabs and ts=4 would be 6 tabs and two spaces(one tab for the initial indent, the rest to match 22 characters). But then someone with ts=2 comes along and barely gets half way there, or someone with ts=8 who overshoots by a lot.

          •  wolo   ( @wolo@lemmy.blahaj.zone ) 
            link
            fedilink
            English
            510 months ago

            That’s not how you should mix tabs and spaces for alignment. You use the same number of tabs as the previous line, and then fill the remaining width with spaces. That way, when you change tab width, the alignment spaces will always start in the same column as the line they’re aligning to, regardless of the tab width.

            • Do most editors do that by default? If so, that’s great – if not, it’s just a downside for tabs, if you need to hit enter, backspace out the automatic indents and then press space 30 times rather than just hit enter and have it aligned automatically.

              vim seems to auto-insert tabs when you hit enter mid-function definition, at least with standard settings.

              •  wolo   ( @wolo@lemmy.blahaj.zone ) 
                link
                fedilink
                English
                210 months ago

                That seems like a problem with Vim, then… Typically I don’t align at all, so I’m not familiar with editor behavior for alignment; I prefer to just indent one level deeper.

          • Setting tabstop and shiftwidth differently is basically legacy braindead behaviour. It is going back to the logic of tab is just a way to compress spaces. If you are doing that then you have all of the problems of both tabs and spaces.

            As for alignment the easy answer is don’t use tabs for alignment. Use tabs for indentation, if you want to align something use spaces for the alignment past the indentation. Lemmy seems to be breaking code snippets right now but I have a really old blog post about this.

            https://kevincox.ca/2014/06/26/responsive-tabs/

            The post is a little out of date when referencing the style of my blog but the C example shows alignment. If you can resize the browser you can see that the indention changes from 4 to 2 as the screen gets narrower without breaking the alignment.

  • Yesterday, I shared some spicy takes. A few were particularly controversial—most notably, that I correct Gif the correct way (with a soft G)

    And I stopped reading there.

  • Years ago there was no way to share IDE settings between developers.

    You ended up with some developers choosing a tab width of 2 spaces, some choosing 4 spaces and as there was no linting enforcement some people using 2-4 spaces depending on their IDE settings.

    This resulted in an unreadable mess as stuff was idented to all sorts of random levels.

    It doesn’t matter if you use tabs or spaces as long as only one type is consistently used within a project.

    Spaces tends to win because inevitably there are times you need to use spaces and so its difficult to ensure a project only uses tabs for identation.

    IDE’s support converting tabs into spaces based on tab width and code formatting will ensure correct indentation. You can now have centralised IDE settings so everyone gets the same setup.

    Honestly 99% of people don’t care about formatting (they only care when consistency isn’t enforced and code is hard to read), there is always one person who wants a 60 charracter line width or only tabs or double new lined parathensis. Who then sucks up huge amounts of the team time arguing their thing is a must while they code in emacs, unlike the rest of the team using an actual ide.

  • The argument for having tabs adjust depending on your ide sounds better than it is in practice. Someone formatting code to look nice with width 4 will look horrendous for someone who uses width 8.

    Spaces makes it uniform and captures the exact style the original dev intended

    • If you have your tab width set on 8, that is on you. You will also set your IDE to insert 8 spaces when you press TAB and I will cry when I have to give you a code review.

      When I indent my code, I am indicating that I am in a nested block. I don’t care if, on your screen, that indent is 2, 3, or 4 characters.

  • I think calling one way better than the other is flawed. The reason the title is saying that tabs are objectively better is because they are used in addition to where spaces are used elsewhere. You could make the same argument in favor spaces due to keeping things simpler.

    The argument of having variable indent size for tabs so viewers can decide how big they are is imho legitimate but also not the goal as it’s addressing something that teams generally agree on. There is max characters per line, brace placement, general code style and rules. Yes we can eject the indentation from the rules that are agreed on but once again simplicity over complexity has an equal say.

    In the end it doesn’t matter that much, a good programmer will be able to work in either setting, the Editor will do most of the work anyways.

    With all that said, spaces all the way!

  • Interesting take. I prefer spaces because 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. Sometimes unadvertently.

    When you remove all tabs at least everyone is on the same page.

    To the actual problem raised by the article:

    I have ADHD. Two spaces per indent makes it damn near impossible for me to scan code. My brain gets too distracted by the visual noise. Someone who’s visually impaired might bump their font size up really large, and need to scale up or down the amount of space per indent. Someone might just prefer it because…

    I wonder if it could be possible to adjust the “indent number of spaces you see” in code editors. Code editors are able to figure out what are indents and what are not, so in theory it should be possible. Perhaps that would be an idea for a new feature?

    • 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”.

    • Yes. That’s what tabs are for. You can choose the width of the tab. It can be small for people with small screens. It can be big for this guy or people with 600 inch ultrawides.

      Tabs are objectively superior because they are exactly what everyone wants at all times, and the git commit history does not get polluted.

  • The choice of having tabs over spaces is essentially the same as putting up wheelchair ramp / elevators, tactile pavement, etc. or not.

    You either care to make life easier for people with disabilities to participate in this particular form of social interaction or you don’t give a fuck because “you don’t like it”.