Chapter 72 JavaScript is really terrible.
Chapter 72 JavaScript is really terrible.
Inside his office, Ling Yun is putting the open-source strategy of the "Starry Sky System" into practice. He envisions an official website that will not only serve as a portal for showcasing and distributing the "Starry Sky System" kernel source code and image files, but will also become a hub for uniting the wisdom and enthusiasm of developers worldwide. A fully functional technical exchange forum is a crucial part of this plan.
However, just as he was getting started and preparing to use the most cutting-edge web technologies of the time—mainly JavaScript supported by Netscape Navigator—to build the forum's dynamic interactive features, he encountered the biggest "dimensional reduction attack" in the technology field since his rebirth.
The feeling was like a race car driver who was used to driving supercars at high speeds on the highway being suddenly thrown into an antique car with an incredibly stiff steering wheel and a throttle response as slow as an old ox pulling a broken-down cart.
"This...this is practically a Stone Age tool!" Ling Yun stared at the few and weak JavaScript codes on the screen, his brows furrowing into a knot.
He needed to implement seemingly basic functionalities in modern web development, such as user registration, posting, replying, and dynamically loading post lists. However, the tool he used was Netscape Navigator from 1996 and its supported JavaScript.
The first problem is the lack of debugging tools. When you write code, the results don't meet expectations. There's no console, no breakpoints for debugging, and a simple logical error can take half a day to locate, requiring countless alert() calls.
The second problem is that DOM manipulation is extremely cumbersome and fragile. The code is long and difficult to maintain, and different versions of Netscape Navigator may also behave inconsistently.
The third problem: cumbersome event handling. Binding a click event to the reply button requires writing a bunch of code to detect browser differences. Event delegation? This concept is practically non-existent at this point; he can only manually bind events to each dynamically generated button, making management a nightmare.
The fourth problem: the lack of asynchronous interaction. He wanted to implement a simple "loading..." message, but at this point, XMLHttpRequest was not available, and the standard asynchronous interaction pattern had not yet been established, resulting in an extremely poor experience.
The fifth problem: the inherent weaknesses of the language itself. JavaScript at this point is more like a toy language. It lacks modular support, has a weak error handling mechanism, and a single script error can paralyze the entire page.
"Snapped!"
Ling Yun finally couldn't hold back any longer. He pressed the Enter key heavily on the keyboard, leaned back in his chair, closed his eyes, and rubbed his throbbing temples. A strong sense of irritation surged up. It felt like an engineer accustomed to driving high-performance sports cars was suddenly crammed into a rusty, dilapidated old car and was required to drive it to conduct a precise technical demonstration.
Netscape's JavaScript is rubbish. The development experience is torture, utterly painful.
He opened his eyes and stared at the bloated and fragile code on the screen, written to create a simple forum. This wasn't just a matter of technological backwardness; it was a strategic shortsightedness.
Netscape is currently basking in the glory of its browser market share, and may still be racking its brains about how to compete with Microsoft's Internet Explorer in terms of features.
However, they seem completely unaware, or rather, not paying enough attention, that the future competitiveness of a browser largely depends on how rich and powerful the web applications it can support.
The foundation of all this is an efficient and easy-to-use web development language and a corresponding toolchain.
A poor development experience can directly deter developers. If developers are unwilling to use it, there won't be a large number of high-quality websites and applications. Without abundant online content, the value of a browser is greatly diminished, ultimately leading to user churn. This is a vicious cycle.
Netscape, as a pioneer in browsers, despite its first-mover advantage, failed to invest enough effort in the crucial area of developer experience, making such a vital tool as JavaScript incredibly difficult to use. Don't they understand that winning over developers is key to winning the ecosystem, and winning the ecosystem is key to success?
Ling Yun stood up, walked to the window, and looked at the Los Angeles night view. His initial agitation was gradually replaced by a cool, thoughtful demeanor. He realized that the collaboration with Netscape might involve significant risks and incompatibilities at the technological level. If they could make even their core browser and accompanying language so crude, then the foundation upon which they built the future ecosystem of the Star System would be unstable.
He needs to wake up Marc Andreessen, and even more so Jim Clark. They must understand that the browser war is not just a war over user interfaces and rendering speed, but a war about developer mindset and ecosystem building. Microsoft is lurking in the shadows, and if Netscape continues to rest on its laurels, disregarding developers and failing to prioritize improving the developer experience, then failure is almost inevitable.
He returned to his desk and closed the forum code file that was giving him a headache. He decided he couldn't just sit idly by, nor could he simply remain at the level of complaining. He needed to prepare a "lesson plan," a "lesson plan" that would be enough to wake Clark and Anderson. He wanted to clearly tell them:
"To create a good browser, you need a large number of user-friendly websites. And to have a large number of user-friendly websites, you must provide developers with a decent tool—a powerful and user-friendly JavaScript library and a good set of development tools! Netscape, can't you put more effort into this?"
This disastrous development experience acted as a fuse, igniting Lingyun's dissatisfaction with Netscape's current technological state and solidifying his determination to take the lead in the browser and web standards arena. Relying on others, especially a partner whose future direction might be unclear, is far too risky.
He clearly recognized a harsh reality: the browser war is not just a war between browsers themselves, but a war between the entire development ecosystem and user experience behind them. If web development based on Netscape Navigator is a painful ordeal, then developers will naturally vote with their feet and switch to other more user-friendly platforms.
Thinking of this, Ling Yun could no longer sit still. He decided that he had to teach Clark a lesson right away!
He shut down the frustrating code editor, picked up the phone on the table, and prepared to call Clark and give him a piece of his mind.
dtnovels