227
tahnik
8y

Well, I guess I won't be able to contribute cause tabs for life

Comments
  • 25
    Make it 4 spaces not 2. Space here, but use tabs to produce 4 spaces.
  • 20
    Guess you could configure your editor's code style preferences to indent 2 spaces? :p
  • 27
    @saiphp that's the thing about tabs. Tab helps us not to worry about this spaces, because it's editor dependent. Spaces on the other hand, is not. It's a hacky way of indenting.
  • 5
    @lotd But I don't want to use spaces ugh :(
  • 5
    Just set your soft tabs to two spaces and be done with it? You can still use the Tab key, it just doesn't use "\t".

    Most editors these days know how to interpret and convert to 4 spaces should you need.
  • 4
    @tahnik maybe this space vs tabs is a thing of the past.
  • 3
    @saiphp it's not a thing of the past. Using rules like this means you are imposing rules on the developer. The width of indentation should always be a personal preference of a developer, not something that is forced on them.
  • 12
    @tahnik while agree with this on personal projects. Every developer using their own indenting methods makes for an inconsistent codebase when collaborating. Code consistecy should always be strictly enforced, even of it means that some "spaces developers" have to use tabs

    Also tabs > spaces
  • 7
    @theaviator well what I am trying to point out. If you use tab, then no one has to enforce anything. Do you like 2 spaces? fine, change the tab size to 2. Do you like 4 spaces? change the tab size to 4. Easy and simple.
  • 2
    @TuxOtaku you can control your editor. You can set the tab width in most of the editor.
  • 11
    Semantics, semantics, semantics! This is one of my biggest pet peeves. Spaces are for spaces, tabs are for indentation. It's not fucking hard. Use the right tool for the job! Spaces are not the right tool. Tabs have no other purpose than for indentation and they give you the flexibility to set the indentation size to you own preference in most editors. There is no argument for the use of spaces other than pure stubbornness.
  • 2
    How nested is your code because 2 spaces is perfect for me. Anything more would cause my lines to reach the next line.

    -React/Node dev
  • 5
    TWO SPACES 4EVA

    #team2space

    Two spaces is lyfe
  • 0
    Tabs hurt my eyes but it may be what you're used to and my code might hurt your eyes
  • 1
    Just set up a code auto formatter and forget about it
  • 2
    Does the project have an editorconfig file? In that case you should be able to get your editor to follow the conventions. If it doesn't have an editorconfig, PR one first!
  • 0
    @TuxOtaku If you think 1 space makes it unreadable than you're doing something wrong
  • 5
  • 3
    Please follow the godamn project rules and style guide. Worst than tabs OR spaces is having both tabs AND spaces.
  • 0
    You can always write privately on your hard disc with tabs. Right before committing just use "find and replace" to exchange each tab with 2 spaces.
    I'm tab lover and this is how would I behave in your situation :-)
Add Comment