Loading ...
Sorry, an error occurred while loading the content.

3148Re: [jslint] Tabs vs Spaces question

Expand Messages
  • Doc Emmett Splendid
    Mar 1, 2013
    • 0 Attachment
      Hi Kirk,

      I also have a strong preference for tabs, as they carry the semantic notion of "one level of indentation". Usually the arguments I see in favour of spaces are around people using them for stylistic formatting rather than indentation, such as aligning all the colons in object notation:

      ~~~~~~~someProperty : "blah",
      ~~someOtherProperty : "blah",
      ~~~~~~~~~~~~~~~~foo : "bar"

      ...which I personally think is silly, ugly and hard to maintain. The use of tabs encourages semantic indentation over that sort of nonsense.

      There's also the matter that I've seen people use nearly every possible NUMBER of spaces for indentation, and insist that their way is the only way of doing it. Specifically, I've been on projects where the number of spaces for a "level of indentation" was 1, 2, 3, 4, 5, 6 or 8 spaces (7 being the one I'm still waiting to see). So the argument isn't even "spaces vs tabs", but "tabs vs 1 space vs 2 spaces vs 3 spaces vs..." and so on.

      That much said, I tend to use spaces much of the time, because most *teams* use spaces. I gave up the fight for semantic indentation as lost years ago. In essence, I'm on your side, but the real world has declared that indentation should be artificial and arbitrary. JSLint is just affirming that, and as it's a real-world-focused tool, it's probably right.


      From: Kirk Cerny <kirksemail@...>
      To: jslint_com <jslint_com@yahoogroups.com>
      Sent: Friday, 1 March 2013, 10:23
      Subject: [jslint] Tabs vs Spaces question

      I am sending this again because I can not believe their are no comments
      about this.
      The debate between spaces and tabs has been raging for years.

      I have been using tabs in my JavaScript because that is the convention
      the web application I am working on. The application includes PHP,
      JavaScript, CSS, HTML
      and other languages.

      I have been JsLinting my JavaScript code for years.
      I love JsLint.
      Recently I have started to get the error of Use spaces, not tabs.
      What is the reason for this?
      What is the danger of using tabs?


      [Non-text portions of this message have been removed]

      [Non-text portions of this message have been removed]
    • Show all 15 messages in this topic