Does JavaScript (ECMAScript5) Strict Mode offer significant performance advantages to merit widespread use?

后端 未结 3 615
一个人的身影
一个人的身影 2021-02-07 20:07

I\'m reading up a bit on using Strict Mode for JavaScript and it seems that, generally speaking, the idea is to force a more rigid set of rules onto the coder to ensure that the

3条回答
  •  孤街浪徒
    2021-02-07 21:01

    I don't know if the performance would be worthy it, but I guess your results may vary. I suppose it depends on your script. But that doesn't mean to be the main point, but reducing your time in maintaining your code. So anything that makes save you time (and money) maintaining your code, and makes it faster, is golden.

    I have been corrected, and, sadly, it doesn't include strong typing. Many years were spent by researchers to enforce typing to detect errors at compile time, and now we have to trust we are code is good, or verify it by hand or unit testing. IMHO, the time spent in unit testing is usually scarce in many places, and it should not be spent on things that could be done by the compiler.

提交回复
热议问题