4 ms·
why? compilers for other languages has compile time switches for various checks and/or optimizations, there it is assumed normal. Javascript's "use strict" is j
by jol 13y ago
why? compilers for other languages has compile time switches for various checks and/or optimizations, there it is assumed normal. Javascript's "use strict" is just a hack for lack such option.
This has some benefits, i.e. you take some codebase that must compile with noImplicitAny and want to add some features, you start with less strict typing (implicit any allowed), when finished you compile with different flag. Because ide (most people use) is recompiling the code all the time there is no reason to clutter this when prototyping.
If you don't like this workflow, just use the flag from step 1.
- Jare 13y agoMy understanding was that NoImplicitAny changes the rules of the language, so its use will make it harder to move code from projects that rely on it to projects that don't. Traditional compilers opt for a rich set of warnings and the ability to turn any warning into error. On closer inspection, it seems that code developed with NoImplicityAny should work 100% on projects without that, so my concern was unwarranted.