52

It still baffles my mind why anyone would prefer spaces over tabs.

Comments
  • 4
    People never understood the real problem with spaces.
  • 7
    @theScientist Well I am not sure if I got this whole thing with tabs vs spaces right, but why would press space four times instead of pressing tab once? Plus when you have to indent to the left you would have to press backspace 4 times or something. I am also quite sure that most IDEs use tabs instead of spaces. :)
  • 16
    It still baffles my mind why would someone care about spaces and tabs with all the ides and auto-formatters unless you are using notepad.
  • 4
    What if I like to use 5 spaces?

    They provide more interesting beats when I have to enter 20 of them.
  • 2
    @jschmold :D thanks for understanding
  • 3
    @jschmold I know, but I'm a Java developer. We don't really have that problem. The only thing more bloated than our platform is our IDEs.

    Everything is autoformatted unless explicitly stated

    Combine that with static code analysis like FindBugs and SonarQube and it starts to get real hard to make bad code. (You can still make bad designs though)
  • 0
    @jschmold haha I don't, I like it. I work mostly on large scale enterprise software. I couldn't imagine all the hoops I'd have the jump through if I didn't have an established infrastructure like maven.
  • 2
  • 5
    being a js developer : why care; it's going to be minified.
  • 1
    @AdrianD what age are you living in man? Who types spaces nowadays when even nano can be setup to use 2 (or 4) spaces when tab is pressed? Plus you never have to actually tap backspace a number of times just to remove indentation unless you're super paranoid. Just embrace spaces bro. Most JavaScript and Haskell style guides recommend 2 spaces where as the default tab size is 4 or 8, so if you'll reconfigure tab handling anyways why not just set tab to use spaces. Python recommends spaces instead of tabs too.
    It is OK if you prefer tabs but wrong to imply that others who use spaces are somewhat bad. Even git can check in tabs/spaces and checkout spaces/tabs if you like.
  • 2
    @AdrianD IDEs and editors can be configured to insert 4 spaces instead of a tab character, while still using the tab key.

    That way there is no argument, we use spaces, end of, but if you want to use one key to insert the set number of spaces, that can also be done.

    Just remap the editor to use tab as spaces then configure the number of spaces. That's how we solved it on the work projects.
  • 0
    It does not matter which one you use as long as you can get EVERYONE ELSE on your team to also use the same thing. This is especially important if you're using languages like Python where it'll just stop saying it encountered incorrect indentation if it sees a mix of spaces and tabs.
  • 2
    @triggerHappy @theScientist @jschmold @tilde

    The reason to use tabs is for consistency. "indentation" if all done in tabs can be consistent to each developers style of tab size. When done with spaces this is not the case.

    Alignment (as opposed to indentation) should never be done with tabs and should be done exclusively with spaces.
Add Comment