Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Tabs vs Spaces

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #160872
    Martin_Muzatko
    Participant

    Hi there!
    I couldn’t find any topic on this.

    Based on the recent published news from chris, someone in the comments asked why someone would prefer spaces over tabs or vice versa.
    I researched this topic a few weeks and months ago to wrap my head around this topic.
    My company uses spaces as default convention. This is because we have some linux or mac users and with spaces you make sure to make it look the same in (almost) every platform, editor whatever. (Including Sublime, Vim, Nano, Textmate, Windows notepad, PHPStorm, Eclipse and etc etc.

    I personally prefer tabs. but that is maybe a bit egoistic, because I do not work with any other people when I work alone.
    I only work with Sublime, so I do not have to care how it looks in other peoples editors.

    The inofficial CSS Guidelines by css wizardry ( https://github.com/csswizardry/CSS-Guidelines#general ) prefers 4 spaces, without actually saying why they prefer them.

    This here is my heavily biased list of cons/pros for tabs and spaces:

    Tabs:

    • (+) I can have them any width I want (at least in my editor)
    • (+) easy removable (indent and unindent)
    • (+) easier to follow the 4-space convention (or whatever convention you follow)
    • (+) in turn: more consistent organized documents
    • (-) not cross platform editor friendly (does not look the same in every editor)

    Spaces:

    • (+) Looks same in any editor

    • (-) not so fast to unindent (if you are not working with sublime or similar editor)

    Looking for your advice and experience :)

    #160962
    TheDoc
    Moderator

    We have set style guides for the company. Here are a few:

    • use spaces for indentation
    • indent by two spaces for all* languages
    • *indent by four spaces for Javascript
    • absolutely no trailing whitespace

    Spaces: (-) not so fast to unindent (if you are not working with sublime or similar editor)

    This surely cannot be counted against spaces. Who isn’t editing code with an editor?

    Tabs: (+) easy removable (indent and unindent)

    How is it not easy with spaces?

    Tabs: (+) easier to follow the 4-space convention (or whatever convention you follow)

    Easier? Says who? Nobody has any problem using our 2-space convention using spaces at our office.

    Tabs: (+) in turn: more consistent organized documents

    Hmmm. Isn’t that the exact argument for using spaces instead of tabs? Tabs lead to inconsistency.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Other’ is closed to new topics and replies.