13 reasons why JavaScript is the future

13 reasons why JavaScript is the future

Remember the time we wrote alert();s and reached Valhalla as our ‘code’ was working within a ‘browser’? Well, the 90s kids will.

JavaScript (client-side code in general) was kind of frowned upon in the 1990s (And so was CSS. But then again, it’s propagated by a handful who could not get their “float:left”’s right. Right?). Programmers hated JS.

So, what has changed so much that JavaScript has become the #1 language of choice of developers today?

13. It’s amazingly fast

Node.js, ES6 et al. comes with a lot of amazing performance optimizations that was handcrafted specially for modern web demands. Performance (Speed) is #1 on that list. Most of this happened due to the work on V8 JavaScript engine.

12. It’s Asynchronous => highly scalable

Jeff Miccolis’ slides mention of how node.js sent out 600 emails in 3 seconds, whereas PHP took 30 seconds (10X) for doing it.

Why? Because ASYNC. That’s why.

11. SSDP (Same Stuff, Different Places)

Name one other language that’s as light-weight, and runs amazing on the server and also the client. I’ll wait.

While you’re at it, do name one other client-side scripting language too.

Even desktop apps like Slack, Wordpress Desktop, Atom are made using Electron, which is essentially a desktop app running JavaScript pages in a Chromeless Chrome browser to make it look like a native desktop app. I'd given it a shot too: Refreshie.

10. Them Brilliant Frameworks

Frameworks like Vue.js, AngularJS, React, Ionic …

Oh yes, let’s not leave out the jQuery lib. Most of us started there.

9. Because, JSON

The WWW did not have a structure. It was just pages and pages linked with each other, each having a mind of its own. SOAP was good enough for the barely-interactive world.

Enter Web 2.0 — A new world of collaboration and socialization that needed a lot of data exchange between servers. The REST is history.

JSON Objects are like the native language for JavaScript.

8. ES6 paves the way

ES6 (ECMAScript 6/ECMAScript 2015) builds on what JS lacked. All the abuses programmers thew at JavaScript in late 1990s, ES6 has learnt from, and adapted.

All updated browsers support ES6, and your favorite IDEs (IntelliJ, right?) have helpers for it already.

It’s not just the speed that has improved, but the language’s elegance too. Just like what Laravel is doing to PHP.

7. Go OO or go functional. Just don’t go home.

You don’t necessarily have to restrict yourself with one.

Sometimes classes are good. Sometimes, your data can be manipulated easily by a set of functions. JavaScript doesn’t care and does’t force you into writing your code in a specific paradigm. Be like JavaScript.

6. Promises!

Promises help eager-load stuff. Promises are a level-up from the callback pattern. Promises are a delight when it comes to async programming, and is what makes a single-threaded lang like JS appear much much faster.

5. The web would be empty without it

A staggering 94.7% of all sites on the web use JavaScript. The remaining 5.3% would probably be static GeoCities homepages built in 1994.

Every single website you visited today used JS.

4. Easily available ‘Packages’

Don’t reinvent the wheel. You can find a package for anything generic thing you can think of.

npm at the moment has over 450,000 packages of free, reusable and modifiable code.

3. Get started quick

Ingredients:

  • A text editor
  • A browser
  • Your time

The language is relatively easy to learn, and debugging too is relatively easy with Unit Tests and Breakpoints. All within your browser.

2. Single-Page Applications

SPAs are fast. SPAs are the apps that make the web. When Google came out with Gmail, we were concerned about its load time. Gone are those days. Embrace SPAs. Coupled with good caching mechanisms and HTML5 APIs like localStorage, we can now create amazing experiences.

No more page reloads. Just lots of REST.

1. Because developers say so

This has got to be the #1 reason. The best language in the world will be worthless if it’s not adopted by the masses.

Engaged communities => more possibilities of finding your answer on Stack Overflow.

As the Ionic survey summarizes, “The web is winning”


Originally Published on Medium

Next Up: CSS Grids — What CSS1 should have come with in 1996!

Clément Fradet Normand

Co-Founder of Clovis.app – Build simply. Together.

7 年

An other reason : Javascript works really fine on Mobile !

Enrique Arizon Benito

Software Gardener and Blockchain consultant

7 年

I think that now that kotlin "compiles" to JS (and webassembly in the future) it will take a couple of years before most JS developers switch to it. Kotlin has all the advantages of compiled and interpreted languages, it's easy to write, easy to read, and very importantly, it captures lot of errors at compile time that standard JS (even TypeScript) is not able to trap.

要查看或添加评论,请登录

Deepak Thomas的更多文章

社区洞察

其他会员也浏览了