State of the JavaScript Ecosystem in 2016

shutterstock_95538487 (1)

Over the past five years, there’s been an immense amount of effort put into JavaScript library and framework development. During that period, JavaScript also transitioned from the ECMAScript 5 (ES 5) specification to ES 6; support for ES 6 in most of the major browsers (Chrome, FireFox, etc.) is somewhere around 90 percent (use the Kangax site to check compatibility for your browser).

ES 6 brings constants, proper classes to JavaScript, lambdas (arrow functions), iterators and generators, and many more features.

For many developers, the most popular library remains jQuery, which streamlines client-side HTML scripting. It was one of the first to achieve universality. Google also sped jQuery up: instead of downloading it from your hosting server, it can be pulled from the nearest Google server via their Hosted Libraries, thus accelerating your website.

Over 50 million websites use jQuery. It can be bundled into popular server-side development systems such as ASP.NET MVC, which minify it (removing whitespaces etc.) and merge multiple files to reduce the number of fetches. (In job searches, jQuery is very popular, notably as an auxiliary skill for C#, Java, PHP and front-end Web development positions.)

Which Library is Best?

If you want to learn JavaScript, you will need to pick a framework or library to help you. The popularity of jQuery stems from how it eliminated much of the cross-browser hassle and made accessing the Document Object Model (DOM) of an HTML document more straightforward.

The major libraries and frameworks are all about accessing and manipulating the DOM. Whether it’s navigating the DOM tree and setting event handlers, or hiding controls, all of the neat stuff comes from DOM manipulation.

One of the nice features of jQuery is that you call methods using the $ syntax, as in calling the farbtastic colorpicker:

$( document ).ready(function() {

$('#colorpicker').farbtastic('#color');

});

(Before jQuery, you called JavaScript in the window.onload function, but nothing happened until all images (including ads) were loaded.)

Getting Up to speed with JavaScript

There are many (perhaps too many) frameworks and libraries out there; one article lists 23 major ones. You can learn a handful, but the world keeps moving forward, and in a couple of years your choice could well be obsolete. For example, Sencha’s Ext.js commercial library has been suffering from a lack of developers.
When in doubt, just pick any two from these: Angular, Backbone, Ember, Vue, and jQuery.

Angular was doing well until Facebook brought out the open-source React; the latter’s approach to rendering a GUI via a virtual DOM has made it the most popular library. Leveraging a virtual DOM and leveraging the differences between it and the real DOM makes webpage updates very fast.

The problem with React is that it can’t do everything itself; it’s just a library. Some third parties have augmented it; for instance, the free React Starter Kit provides other stuff, including Babel and Webpack.

Frameworks or Libraries?

Some authors believe that frameworks are evil, and that tethering your app to a particular framework will rob you of flexibility. Once you’ve gotten a feel for JavaScript as a language, consider relying on libraries; you can use them without incurring dependencies, in the same way you do with frameworks.

Package Managers

Just to add a bit more confusion to the mix: do you want to use a package manager, or just install things manually? The best-known package manger is NPM, which grew out of the server-side node.js project. The library contains over 300,000 retrievable modules; the most popular downloaded packages include bower, a package manager for front-end packages.

Conclusions

With JavaScript, we’re still seeing evolution in action: new frameworks built on the best features of earlier ones, with everything still very much in flux.

Whether you’re just exploring the potential of JavaScript, or consider yourself an expert in the language and ecosystem, there’s no right answer as to what’s best for you. The size of the project has a lot to do with the tools you choose; React, being one of the most popular, pops up in a lot of job descriptions (although not as many as Angular).

In programming, there’s always the concern that what works now will become obsolete within a relatively short period of time. Combine that with the usual dithering among teams over which methods will work best, and it’s clear that the coding itself isn’t always the most difficult part of the creative process—it’s figuring out all the aspects of how to proceed.

The days when you could create a working website with very little third-party input have passed. Concerns about speed, responsiveness and security make it likelier than ever that you’ll need to use a library or framework for any but the most trivial website. Getting familiar with libraries and frameworks, therefore, is one of the most effective things you can do when attempting to master JavaScript.

Image Credit: Antonov Roman/Shutterstock.com

Post a Comment

Your email address will not be published.