神刀安全网

What if we had a great standard library in JavaScript?

Over the last few years the “authorities” of the JavaScript world concentrated on adding ever more features to the language and building a sprawling library of modules and packages.

As of right now (9:52 AM ET on March 26, 2016) there are 259,191 packages on NPM. Yes, that’s more than a quarter million packages.

The ES6 standard (aka the next major version of JavaScript) adds a huge amount of features to the language, among them arrows , classes , enhanced object literals , template strings , destructuring , default + rest + spread , let + const , iterators + for..of , generators , unicode , modules , module loaders , map + set + weakmap + weakset , proxies , symbols , subclassable built-ins , promises , math + number + string + array + object APIs , binary and octal literals , a reflect api and tail calls .

Now, what is the point of all this? Will it make it easier to write apps? Will it make them work better?

How have we been able to make useful software in JavaScript all this time?

Growth for the sake of growth is the ideology of the cancer cell.—Edward Abbey

Many of the packages on NPM are literally one-liners. Why would people include a one-line-of-code library in their projects and not just write it themselves? Is it lazyness? I don’t think so—it’s more of a convention in the JavaScript world that everything should be compartmentalized, filed away in neat little modules and all held together by some dependency pyramid scheme.

I don’t think short and to the point libraries are evil. I actually launched Micro.js a few years back to highlight useful, small libraries. However, I do not think the proliferation of essentially trivial code snippets that are packaged up is a good thing.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » What if we had a great standard library in JavaScript?

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮