3

Is the Future of JavaScript Doomed? | by Jose Granja | Jan, 2022 | Bits and Piec...

 2 years ago
source link: https://blog.bitsrc.io/is-the-future-of-javascript-doomed-2993373f0f36
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Is the Future of JavaScript Doomed?

A look into the state of JavaScript in 2022 and beyond

Caption By Author, Skull Designed by dgim-studio / Freepik

The JavaScript language has had an exciting ride so far. Ten years ago it seemed like everything had to be built with JavaScript. The release of jQuery and Chrome were its catalysts.

The TC39 committee has always played a big role. By standardizing the language and designing new specs, it has made it what it is today.

However, six years have passed since the release of ES6/ES2015. The trend about one language — JavaScript — to rule the whole stack is now gone. How does that affect JavaScript? Will it continue to dominate? As we might transition to other devices such as VR, will it become obsolete?

In this article, we will see the past, present, and future of the language. That will hopefully give us an idea of where we are headed.

JavaScript’s Present Popularity

There’s no absolute metric to measure the popularity of a language. However, what we can do is look at various indicators and make our own conclusions:

  • Repository Usage on GitHub
  • The TIOBE Index
  • Job Listings
  • StackOverflow's Insights
  • Surveys

Most of those metrics will reflect the current JavaScript dominance. It is the most used language in GitHub.

1*SUPILywy9_a1qLKkeaXtJQ.png?q=20
is-the-future-of-javascript-doomed-2993373f0f36
Caption from GitHub

If we look at job listings, JavaScript is still in high demand. It holds the number 1 spot on the ‘Top 11 Programming Languages’ listed in Indeed.

It is also loved by developers as we can see in the a surveys held by StackOverflow:

1*jycfeh9E5Kugcn43nhrcgw.png?q=20
is-the-future-of-javascript-doomed-2993373f0f36
Caption from insights.stackoverflow.com
1*s8TzE3C-ilI26_S_fdMszA.png?q=20
is-the-future-of-javascript-doomed-2993373f0f36
Top Languages over the year on octoverse.github.com

However, it is all not so bright. It has a “low” rating in the TIOBE index. How is that index calculated? It is basing the rating of a language on the number of resources available in popular search engines queries containing the name of the language.

1*uHm63LwZ0CqsHIR_0LzjUQ.png?q=20
is-the-future-of-javascript-doomed-2993373f0f36

JavaScript’s influence is eroding

We come from an era where JavaScript was used everywhere. Its true nature is now shaping its future. We see JavaScript eroding where it does not shine or is outperformed.

Server Side

The Node.js boom was partly triggered by the excitement of having JavaScript all around. Reducing the language stack could see benefits like a single developer working across the whole application.

Node.js has gone a long way and tried to solve problems like multithreading by adding new features like the worker_threads module. However, it remains a build on top of Chrome’s V8 JavaScript engine. Its lightweight characteristics make it ideal for micro-services and high-efficiency backend applications. It is also suited for Lambdas where it is still one of the most used languages.

However, Node.js has a few problems. It is a complex platform that is becoming really challenging to upgrade and maintain. Its creator itself left the project and started Deno. Written in Rust, Deno got a lot of initial hype. However, it has not taken over and still needs time to mature.

What does this mean for Node.js on the backend? That Node.js will be constantly narrowed down to its more suited usage. Languages like Python are taking over that void and are skyrocketing. It is now the go-to language used by startups.

Infrastructure tooling

JavaScript tooling is shifting. It’s not 100% JavaScript anymore. We are seeing how the Rust programming language is becoming a key part of the new JavaScript projects.

Deno and SWC projects are amongst the most popular ones. The SWC is a Webpack competitor. Its goal is to compile and build JavaScript/TypeScript files to be supported in major browsers.

SWC is 20x faster than Babel on a single thread and 70x faster on four cores.

Its bundler is still not production-ready but you can use it through the swc-loader in Webpack. It’s not the only one trying to debunk Babel and Webpack. The language go-based ESBuild project has been built with the same goal. There are other tools like Rome which are now being completely being rewritten in Rust.

The future of JavaScript tooling is not in the JavaScript language. We can see a shift in the mid-run to take advantage of those powerful tools. There’s no real benefit in keeping JavaScript utilities when they are so outperformed. Is that a bad thing? No, the side-effect is getting more efficient and better tooling as developers. We can focus on producing quality code.

Web Assembly

Web Assembly makes possible things that couldn’t be done with JavaScript. It enables us to run compiled code in the Browser. This solves some downsides of JavaScript: typing, performance, and security.

That’s not bad news. Web Assembly won’t be replacing JavaScript but complementing it. It will empower web experiences that couldn’t be done before. That enabled Adobe to create its long-desired Photoshop Beta Application.

So we will see that to see a different set of web applications. The majority will still be rocking JavaScript for the layout and interactivity. So Web Assembly might actually expand further the reach of the Web.

Write once, run everywhere

This trend is still hot. The go-to framework has been the React framework for years. It is mature and has a big community behind it.

However, we have seen how Flutter and its Dart language gaining a lot of traction.

1*hCKjdBFwZ9dP2werOreA_w.png?q=20
is-the-future-of-javascript-doomed-2993373f0f36
Caption from insights.stackoverflow.com/trends

The Flutter framework is more efficient and performant than React on mobile devices. It is also capable of providing a web application. The fact that there are few job listings is preventing it from growing faster. But it’s just a matter of time before that trend is reversed. Overall developer satisfaction appears to be higher among Flutter users. The framework has a wider and better abstraction set. It is also painless to upgrade.

So, will React Native disappear?

Not really.

The React development is shifting after release 18. It will be considered more like a platform than a web framework. That means that by learning React you can apply that to any platform that they support.

The Future of JavaScript

Unfortunately, some hot topics like Crypto, VR, AI have not been paired with JavaScript. Why? Because it doesn’t make sense to. JavaScript is not particularly well suited for VR or AI. Some newer languages — like Solidity — are built instead with one sole purpose: Smart Contracts.

However, JavaScript might still benefit from new technology. Even if the Crypto space is not bound to JavaScript, its technology is still used to bring decentralization to the web. We have just entered the new Web3 era. New projects keep on appearing daily. This trend has the potential to become massive.

JavaScript is being used less and less in its purest form. TypeScript has started to take over. It has proven how powerful and useful it is. It is the default language in many projects and frameworks. For example, Deno provides first-class citizen support for TypeScript.

Top Languages over the years octoverse.github.com

We can see in the above graph how it is now the fourth most popular language according to the Octoverse report. We are rapidly moving to the TypeScript everywhere trend.

TypeScript is so popular that it already has a popular competitor: ReScript. It is a new language built on top of a curated subset of JavaScript. It has many advantages like providing efficient human-readable JavaScript code, and a fast compiler. It remains to be seen if it will be widely adopted or just forgotten.

Conclusions

There are rumors each year, each telling the tale of how JavaScript is going to disappear. Those claims continue to be debunked year after year. Even if its future now looks to be a bit bumpier than ever, it is just how progress works.

It is unclear whether JavaScript will stay relevant in the mobile native realm. Flutter has many key advantages over JavaScript. Whatever happens, the React Native team can be expected to put up a fight.

Even if its presence might diminish in the near future, JavaScript isn’t going anywhere. We can foresee a future where JavaScript is progressively more confined to the Web though. That is expected since it is the place where it truly shines.

It has the potential to benefit from technologies like Crypto and Web Assembly. Instead of competing with JavaScript, other programming languages will complement it. They are helping to make the Web a more exciting ecosystem.

Bonus: The Future of JavaScript is Micro Frontends and Component-Driven Development

Microfrontends are a great way to speed up and scale app development, with independent deployments, decoupled codebases, and autonomous teams.

Bit offers a great developer experience for building component-driven Micro frontends. Build components, collaborate, and compose applications that scale. Our GitHub has over 14.5k stars!

Give Bit a try →

0*7OCJ5MkhAaNsAxCe.png?q=20
is-the-future-of-javascript-doomed-2993373f0f36
An independently source-controlled and shared “card” component (on the right, its dependency graph, auto-generated by Bit)

Learn more


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK