Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"use strict" #11

Closed
zenorocha opened this issue May 1, 2012 · 6 comments
Closed

"use strict" #11

zenorocha opened this issue May 1, 2012 · 6 comments

Comments

@zenorocha
Copy link
Member

Should we use it on these patterns?

@yckart
Copy link
Contributor

yckart commented Nov 24, 2012

I want to say yes! But, what is about those people who dont know about the "disadvantages"?!

@addyosmani
Copy link
Member

+@sindresorhus

I'm tempted to say we should use it on these patterns and make a note about it in the readme/docs. An extract derived from John Resig's post about use strict:

Strict Mode is a feature in ECMAScript 5 that allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions.

Strict mode helps out in a couple ways:

  • It catches some common coding bloopers, throwing exceptions.
  • It prevents, or throws errors, when relatively "unsafe" actions are taken (such as gaining access to the global object).
  • It disables features that are confusing or poorly thought out.

@yckart
Copy link
Contributor

yckart commented Nov 24, 2012

Maybe the document from MDN about "strict mode" is a better point to read for unsuspecting.

@addyosmani
Copy link
Member

or that ^. I'd be down with either.

@sindresorhus
Copy link
Contributor

Yes!

There are no downsides if you know what you're doing. For everyone else there's documentation, preferably the MDN one.

@addyosmani
Copy link
Member

Let's get this in sometime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants