72
lars
8y

Friend: "I use spaces to indent"

Every self respecting programmer: "I think we can no longer be friends"

Comments
  • 9
    That's cool, I'm a self respecting developer... I use spaces! *Runs for cover*
  • 1
    Is there any legit technical reason for using tabs over spaces for indentation?
  • 0
    Tabs > spaces

    I really don't see any point in using tabs
  • 0
    @MasterYushi smaller filesize, more flexible, less keystrokes
  • 0
    @Krokoklemme well not really lesser keystrokes, everyone uses auto indenter, some of them use tabs, some use spaces, some even let you choose
  • 1
    @MasterYushi then there's no point in arguing about that in the first place
  • 6
    @Krokoklemme I press tab once to indent with two spaces
  • 8
    I always use spaces for indenting. The amount varies, but it is usually some random prime number, except during the summer and winter solstice. During those, the number of spaces is mostly determined by some ritualistic sacrifice (mostly humans, sometimes other animals).
    I only use tabs for line breaking.
  • 7
    Spaces are rendered basically the same everywhere, tabs are not. Tabs are rendered as 8 (!!) Spaces on github! I want my code to be on the page, not on the fucking moon. There is no actual benefit to using tabs, while spaces have the aforementioned benefit of consistency
  • 0
    @heikomat tabs have the benefit of flexibility

    And I don't know how you messed it up, but tabs are 4 spaces wide for me on github
  • 1
    Took one look at the title...

    http://i3.kym-cdn.com/photos/...
  • 0
    Newline to indent ftw
  • 4
    Will they ever come to an conclusion? Will the smaller file size or the homogenous code indentation win? Stay tune for next weeks episode where we tackle the old question: Vanilla or Chocolate? That and more next time on "Useless Arguments".
  • 0
  • 2
    @heikomat you got it inverted, spaces are inconsistent because you can put a different amount of spaces, but you always put the same amount of tabs. Tab is, by definition, an alignment character meaning it's supposed to align your code to the same indentation (of your choosing normally). These days, IDEs do "magic" and it's pretty much irrelevant whether it's a tab or space, other than for the file size (everything else is "magically" equalised by parsing both as an abstract indentation character pretty much the same as tab).
    However, doing that is like using a hammer to open beer. Sure, you can do it, even if it's not as convenient as an actual bottle opener, but why would you use a hammer if a bottle opener is right next to it?
  • 1
    @Bikonja i like the way you argue, and you have good points. The tab is technically the correct tool to represent alignment, but at the end of the day, the space seems to work ever so slightly better for what I do than the tab does. And I prefer the wrong tool over the correct tool, if it works better than the correct one.

    And so far I've had zero problems working with spaces, but I did encounter the github-problem I mentioned when dealing with tabs.
  • 2
    @heikomat I have no problem with people who like using the wrong tool. If it works for you, that's fine. I do have a problem with people who insist that the wrong tool is the right tool, that's why the tabs vs spaces debate riles me up so much; most people swear that space is the correct tool which pisses me off to no end. Use a fucking emoji for indentation if you want as long as you don't pester me how it's better and it doesn't inconvenience me.
Add Comment