End Statement the Future of Java Script Originates From an End as a Beginning

End Statement The Future of JavaScript Originates from an End as a Beginning #

Hello, I am Ishikawa.

This year has been quite unusual. Our thoughts have been somewhat fragmented, and it is difficult for everyone to have a strong consensus on certain matters. However, I feel that there is one thing we can all agree on, and that is the presence of “uncertainty” as a key theme for this year.

Each person has their own way of understanding the world, and for me, JavaScript is the language I use to comprehend and adapt to uncertainty. From the beginning of this column, we have mentioned that JavaScript is a language that is not very strict and even has many flaws. However, this does not stop people from creating different frameworks and libraries around JavaScript to overcome these issues. I believe that this trait of JavaScript is a reflection of ourselves. None of us are perfect, and our environment is constantly changing. Yet, this diversity has created a multi-faceted world.

During Teacher’s Day this year, I received a good book from Geek Time called “Making Myself a Method,” which is a dialogue with sociologist Xiang Biao. I first became aware of Xiang Biao through his paper “Transboundary Communities: The Life History of ‘Zhejiang Village’ in Beijing” and his book “Hunting Global Bodies.” What impresses me about his work is that each viewpoint stems from personal experience. In today’s world, which is overly centralized, we may prefer to blindly follow the opinions of opinion leaders or believe in abstract concepts, while disregarding our own experiences.

For me, starting from JavaScript as an anchor extends my understanding of the world. Because it is the language I have been using daily for a long time, it is real and does not require me to abstractly interpret it from the thoughts of others. Additionally, many of its fundamental logics align with many other things. In other words, I believe that the more we focus on seemingly inconspicuous matters around us, thoroughly understanding and refining them while maintaining a comprehensive perspective, the easier it becomes to draw connections and comprehend things that are distant from us.

So how do we thoroughly understand something? Taking JavaScript as an example, I believe that the first step is to identify its core problems, and then determine how to solve them. These two aspects carry equal weight. In other words, if we can clearly define the problems themselves, it is equivalent to solving half of the problem. If we can also devise solutions based on this foundation, then we can truly master it.

Uncertainties Faced by JavaScript #

First of all, JavaScript is a language that has been designed and implemented in a very short period of time. There has been a lack of thorough deliberation, which leads to a multitude of uncontrollable factors when we encounter various exceptions during development.

Secondly, the runtime environment of JavaScript is also full of uncertainties. After writing a piece of code, we do not know the specific environment in which it will run. This is because different users may be using different operating systems and browsers from various manufacturers. Factors such as the version of the JS engine, screen size, and whether it is mobile or desktop, all come together and can create thousands of possible combinations. Furthermore, the network conditions, bandwidth, and geographical location of the users accessing our web application are also uncontrollable. Our developed program must be able to run in most environments, which is itself a challenge in the face of significant uncertainties.

At the same time, the uncertainties of JavaScript are not only inherent in the environment. Another source of uncertainty comes from our users. Many times, we cannot control how users interact with our application. We do not know which feature of our application they will use first, which one they will use afterwards, and there may even be some features that users have never used before. Moreover, we cannot fully control the user’s behavior trajectory. For example, in a ticketing application, some users may find and purchase a product through a search, while others may find and purchase a product through filtering criteria. Some users may add items to the shopping cart first, while others may choose to make a direct purchase. These different behavior trajectories require corresponding system processes to support and handle.

The fourth point is non-functional, such as uncontrollable traffic. We do not know the number of users and the scale of their visits. We can only estimate and analyze the traffic of our system. Typically, different levels of traffic directly impact the performance of our system, resulting in changes that affect user experience and functionality on the client-side.

The fifth point is uncontrollable business requirements. Because our application directly faces customers, our programs need to iterate continuously and rapidly to meet the demands of the business. The more complex the business scenarios, the faster the requirements change in fierce competition.

Solutions to JavaScript Problems #

As a frontend developer, we deal with a lot of uncertainty on a daily basis. However, this has not hindered the development of many mature and reliable systems in this uncertain environment. So what are the characteristics of these systems?

The first characteristic is reactive programming. The essence of reactive programming is continuous perception and response. For example, in the face of changes in user behavior, we need to continuously process based on events. At the same time, the more complex and unknown the scenario is, the more we should ensure control over side effects. We need to know how to ensure that the same function operation produces the same results under the same input. In order to guarantee immutability, we should operate on copied data or objects as much as possible without changing the state itself.

The second characteristic is object-oriented programming and design patterns. Only when we design our systems and programs based on business objects and domains can we better respond to the challenges brought by changes in the business. Therefore, a good software developer is definitely also a good business analyst. Only when we have a deep understanding of the business logic can we write the corresponding programs better. Otherwise, we are prone to repetitive development, rework, and a lot of refactoring to meet business changes.

The third characteristic is the algorithms we use in development. When the memory, access, data processing, and access frequency consumed by our program are not high, algorithms may not demonstrate their value. However, when our business volume and data volume grow, or when the content to be rendered increases, we will encounter various performance bottlenecks. At this time, we need to use algorithm thinking to solve some problems. Moreover, the more complex the problem, the more it tests our fundamentals.

The fourth characteristic is the tools we use in development. For example, Flow helps us overcome many shortcomings of JavaScript to a large extent, allowing a casual and less rigorous language with no strict type system to perform related type checks.

The fifth characteristic is the domain-driven design concept and the concept of the “Big Frontend” introduced in the JavaScript field. Essentially, these emphasize the importance of business-driven development. From a certain perspective, this design concept requires us to start with the end in mind and constantly think about the purpose of our development.

Why is it said that knowledge can be applied beyond its original context? #

I believe that what I have learned during the process of resolving the uncertainties of JavaScript can be applied in various aspects of life. Let me give you a few simple examples. For instance, when we talk about responsive design, it applies to life as well. We need to face uncertain situations and find solutions. In the face of the unknown, we can almost use the template of taking action first, perceiving later, and then reacting.

Another example is algorithms, and we cannot ignore dynamic programming. Similarly, when facing problems in life, we often need to consider the global optimal solution rather than just a local one. Otherwise, we may often lose sight of the big picture. Due to being excessively greedy, we may fail to find the optimal solution for a larger problem.

Furthermore, in the development process, if we truly want to achieve twice the result with half the effort, we must constantly understand the needs of the business, thoroughly comprehend the business processes, and think about how to optimize the development pipeline in order to improve efficiency. Here, it is closely related to software engineering. Therefore, when it comes to development, it is not just about solving simple development issues; it extends to the ability to analyze business systems and manage projects.

Douglas Crockford, a guru in the JavaScript community, introduced a controversial concept this year, arguing that JavaScript is dead. Although this point of view appears radical, I believe that JavaScript is not completely replaceable. However, even if JavaScript becomes history one day, its position in the history of programming languages will remain unshakable, and many of its ideas will continue to be inherited by any language that intends to replace it.

In fact, for a long time, I envied backend developers. They are like “good students.” And I think it is more suitable to learn it as the first programming language, such as C++ or Java, because they have more rigorous syntax, and a good foundation and solid basic skills are the key to solving any complex problems.

Although JavaScript is very useful, precisely because it is so easy to get started with, many people cannot use it well. Moreover, there are numerous issues to consider in frontend development. However, as time goes by, I gradually accepted JavaScript because it is precisely the various problems and uncertainties it brings that enable us to develop the ability for deep thinking and become more resilient individuals while overcoming these problems. At the same time, compared to the backend’s “one size fits all” approach, the frontend’s “tolerance” towards many problems has also contributed to a more inclusive development environment. It is precisely through continuous changes and uncontrollability that we constantly adjust and optimize system stability. In this process, we pay more attention to how to minimize side effects and enhance our ability to establish order in chaos.

Coincidentally, this conclusion is written during the New Year, a time to bid farewell to the old and welcome the new. At this moment, I hope that you, who are reading this article, can embrace uncertainty better in the new year through the language of JavaScript.

Finally, I have prepared a graduation questionnaire for you. I hope you can take two or three minutes to fill it out. I am very much looking forward to hearing your feedback on this course.

Image