Web Analytics Made Easy -
StatCounter "use strict" - CodingForum

Announcement

Collapse
No announcement yet.

"use strict"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • "use strict"

    See http://ejohn.org/blog/ecmascript-5-s...json-and-more/

    If I rework my scripts to work with "use strict", in theory, will they generally perform better, despite potential scripts growing in size? I hear there are some optimizations browsers will do and the changes may help. If so, would these optimizations be automatic or should I leave "use strict" in place to trigger them?
    Go to:
    http://www.TailsArchive.net/
    http://xfox.proboards21.com/

  • #2
    stict mode is less powerful and easier to compile. if you have performance problems, use strict MAY help, but only in browsers than support it. On the other hand, JIT is so advanced these days performance is not nearly as important as it was when ecma5 was drafted just a few years ago...

    in general, strict kills many potential performance-hampering features of js like with and eval. Those commands don't always hurt performance, but they certainly can, and avoiding them means you avoid the potential problems. So, just writing code that works with the strict sub-set of valid js is likely just as good as formally declaring strict mode.

    Strict does make it easier to maintain that discipline because it throws errors when you break the guidelines. but i don't think the guidelines are all that relevant anyway, provided you know exactly what/how you are programming.
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

    Comment

    Working...
    X