We can rebuild the web: better, stronger, faster than before

We can rebuild the web: better, stronger, faster than before

If you have written a webpage in the last 20 years, there is a good chance you've written some JavaScript. For most of those 20 years, the core language has pretty much remained the same. The core of the code you wrote for your personal webpage in the 90s wouldn't look terribly different than the code you'd write years after that.

As a consequence, this style of code has become ingrained into a lot of programmers. One of the best things you can do for a JavaScript codebase today is to take advantage of all of the new language features in ES6. It produces much more expressive and flexible code in less lines.

To demonstrate, I took one of the most common algorithms (Quicksort) in CS classes and wrote it in idiomatic ES5 and ES6.

ES5

ES6

The ES5 function is almost twice the amount of code for the same exact functionality. Once you are familiar with ES6 syntax, you'll notice that coding JavaScript will not only become easier to code but quicker to read and debug.