Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Where is the future of JavaScript?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

In this issue, the editor will bring you about the future of JavaScript. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

As a software developer who has witnessed the development of programming languages in the past 17 years, the author tries to make some predictions about JavaScript in this article.

Today, JavaScript is ubiquitous, not only in front-end (browser) and back-end (Node and Deno), but also in mobile phones, computer desktop software, and even a mix of both. It has become one of the most desirable job skills for job seekers in 2020 (according to the StackOverflow developer survey).

But why is this so? What does this mean for the future of JavaScript? will the development of JavaScript go smoothly? Will a newer and better language be born in the future, thus overturning the omnipotent status of JavaScript? This article will explore these possibilities.

What makes JavaScript so popular?

Whether you like it or hate it, there is no doubt about the popularity of JavaScript. According to TIOBE's popularity index, JavaScript currently ranks seventh among the top 10 languages.

These are not random numbers or biased opinion polls, these data can analyze our market, survey millions of developers around the world, and everything shows that JavaScript is one of the hot languages in 2020. What do you think of this?

Of course, there may be many different answers to this question, depending on what you value when choosing a programming language. This is my opinion:

There is a huge community behind it.

A lot of interesting stories have taken place around the fact that JavaScript external frameworks may be used more than actual developers. Although this may be an exaggeration (note that the author here means "possible"), it stems from the fact that so many of us are trying to make the language our own. This is not a bad thing, it proves that this is a community full of vitality and constantly trying to develop.

One of the things I miss very much when I have to use other languages is that people can get a lot of support and help from the original community. This is definitely a sign of progress, which needs to be improved, and is expected to make more achievements in the future.

The appropriate way of development.

Framework and library aside, the language itself is constantly evolving. Fortunately, however, this change is not controlled by one entity.

To be clear: although JavaScript itself (the term) is owned by Oracle, the language follows the ECMAScript specification. In fact, these norms are indirectly controlled by the community itself and supervised and organized by the TC39 committee.

Develop the language by considering all the different suggestions and keep running until the language is mature enough. After that, if you want to be compatible, these updates are implemented by routines, and there are disputes between browsers after that.

As a developer, you must strive to stay within the scope of compatibility and standards, because you prefer your code to be compatible across browsers. This is no longer the case, and all routines are trying to keep up with the latest version of ECMAScript.

A vibrant ecosystem.

This is very similar to the first point. There are more front-end frameworks to try, and there is no need to learn all of them. Millions of modules are shared in NPM alone every day.

This creates a lot of trouble for people who are new to the programming language, but it also attracts more people to join. Different frameworks and modules will eventually achieve the same thing, but in different ways. And these different ways help to resonate with more individual developers. After all, React, Vue and Angular can all help developers create the same APP, as long as they choose the one they like.

So, considering the situation a few years ago and its development, what do you think of the future of JavaScript?

This is definitely a difficult question to answer. Let's take a look at the author's idea first.

Recent changes

In the past few years, the language has been developing continuously. If you are new to JavaScript, you may not have noticed that there has been a qualitative leap from ECMAScript version 5 to version 6, and there should be a lot of changes in future versions. If it continues to maintain its current path and speed of development, the author thinks that it may be like this in the near future.

JavaScript as the target language

Even though JavaScript has an amazing community and does a lot of work providing tools and frameworks for developers, there are still a large number of people who hate JavaScript for no reason.

Yes, yes, there are people who hate it, or at least don't like its big guy, and think they can do it better. As a result, there are projects like CoffeeScript and later Dart and now TypeScript.

This is not a bad thing, in fact, it is a very good opportunity for JavaScript not only to be widely used by developers around the world, but also to become a target language for many transpiler creators, trying to provide developers with other options.

In essence, this movement will open the door to a different universe for JavaScript. Since Node.js entered the market and became popular, JavaScript is no longer a "front-end language", allowing companies to simplify their technology stack to form a cross-domain single language.

Think about what would happen if you could do this with Python or Ruby. It's not a crazy idea. There have been projects trying to achieve it in the past, and we may just need more time.

The problem with front-end development (which I think is the only problem) is that you need to learn JavaScript to work. This is the exact opposite of the back-end world. Currently, browsers only allow one language to be king, and that is JavaScript, and if you want more languages, you must compile (or port) your code to JavaScript.

Of course, there is WebAssembly, which is likely to replace JavaScript if they have more ability to access other areas, such as DOM. But now it can only work in a very narrow area: a lot of front-end computing. This is a performance tool, not a completely independent front-end development environment.

An example of evolution

Another way for JavaScript to evolve today is to see the needs of the community through a framework developed by the community. If you've been using JavaScript for a while, especially since ECMAScript 5, you might remember libraries like lodash and underscore.

These libraries are necessary for the project because they add additional capabilities to the language, such as map, some, find, reduce, get, set, merge, and so on. Although some features have infiltrated the language itself in recent updates, there is still a need for these libraries to exist.

For example, ECMAScript 6 adds a lot of array methods, which brings considerable improvement to the programming algorithm. The optional chain makes the get method obsolete, or almost obsolete. The propagation operator also almost eliminates the merge method, and the list continues to be updated. The more popular a feature is, the more the TC39 committee will try to incorporate it into the language.

Another obvious example is how to introduce classes. JavaScript tried to maintain its original mind in a user-oriented world, but it failed. Either because there are not enough supporters, or because there is no correct documentation. But so many developers tried to forcibly build an OOP model on the upper layer, so they ended up adding a thin OOP layer on the upper layer.

At first this is superficial, but with the addition of private fields soon, it is slowly evolving into a more mature model. The obstacles are long, which is just an example of how the language has evolved, and although it goes against its original intention, the strength of the developer community is supporting it.

The last new framework is the Svelte framework, which attempts to bring reactive concepts into the language itself, unlike other frameworks such as React, which instead tries to provide developers with working methods and impose concepts that JavaScript is not ready for.

Using the Svelte framework, you can write code like this:

Let count = 0; functionhandleClick () {count + = 1;} Clicked {count} {count = 1 times'}

There is a button and the label value will be updated when you click on it. Of course, currently this needs to be compiled into actual JavaScript, how long do you think it will take to absorb similar examples into the appropriate ECMAScript specification?

This is where the future of JavaScript is shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report