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

Re: [jslint] use strict

Expand Messages
  • Luke Page
    ECMAScript 5 may be (negligably) faster, but the main benefit you get is in using/preparing to use a language that is more sane and developed and is the future
    Message 1 of 7 , Nov 3, 2010
    • 0 Attachment
      ECMAScript 5 may be (negligably) faster, but the main benefit you get is in
      using/preparing to use a language that is more sane and developed and is the
      future of JavaScript. I'm sure you'll find lots of links as to the
      advantages if you google it. It shouldn't make your code slower.

      On 3 November 2010 13:34, James <jacob@...> wrote:

      >
      >
      > Yes, I understand. But why should I? If I always drive the speed limit, why
      > should I put a speed regulator on my car? There may very well be a reason, I
      > just want to know what advantage there is for me.
      >
      >
      > --- In jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>, "Rob
      > Richardson" <erobrich@...> wrote:
      > >
      > > "use strict" identifies you're opting into the ECMAScript 5 mode of the
      > same
      > > name.
      > >
      > > Rob
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Joshua Bell
      ... This post has a reasonable summary: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ In browsers today, the use strict directive does nothing.
      Message 2 of 7 , Nov 3, 2010
      • 0 Attachment
        On Wed, Nov 3, 2010 at 6:34 AM, James <jacob@...> wrote:

        > Yes, I understand. But why should I? If I always drive the speed limit,
        > why should I put a speed regulator on my car? There may very well be a
        > reason, I just want to know what advantage there is for me.


        This post has a reasonable summary:

        http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/

        In browsers today, the use strict directive does nothing.

        In future browsers, the use strict directive will cause subtly different
        behavior in parts of ECMAScript you probably shouldn't be using anyway.
        JSLint attempts to warn you about some of those. Tracking es-discuss, it
        does not appear that there are any fully conforming ES5 implementations, so
        it is not possible to verify that your scripts are, in fact, strict-mode
        compliant. (That is, that they behave as you would expect.)

        IMHO, unless you are aware of the differences to the language that strict
        mode introduces, the safest thing to do at this point is to ask JSLint (or
        similar tools) to look for strict mode violations, but not deploy with a
        "use strict" directive.

        -- Josh


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.