“The best thing we can do today for JavaScript is retire it,” says JSON creator Douglas Crockford • DEVCLASS

JavaScript, the world’s most popular programming language according to most surveys, has become an obstacle to progress, according to Douglas Crockford, creator of the JavaScript Object Notation (JSON) specification used everywhere to serialize data in web applications.

Crockford made this claim in an interview last month:

“The best thing we can do today for JavaScript is retire it. Twenty years ago, I was one of the few supporters of JavaScript. Its intertwining nested functions and dynamic objects was brilliant. I’ve spent a decade trying to correct its flaws. I have had little success with ES5. But since then, there has been a strong interest in inflating the tongue further instead of improving it. So JavaScript, like other dinosaur languages, has become an obstacle to progress. We should focus on the next language, which should look more like E than JavaScript. ”

JavaScript is the most popular programming language in the world according to most surveys

According to a StackOverflow survey earlier this year, JavaScript is used by over 65% of developers, far ahead of runner-up Python at 48% (ignoring HTML, CSS, and SQL which are not generic languages). It is an unlikely result considering its origins.

Brendan Eich invented the language for Netscape in 1995, apparently in just 10 days. “In May I did 10 days of hard work, I didn’t sleep much,” Eich told the dot.JS conference in 2018. In 2012 Eich told Computer’s Charles Severance that: “I started making … a language. programming for HTML, for use by web designers and programmers, embedded directly into the web page … not like Java, which was a professional language where you ran real code with type declarations and had to write in a way that compiled. ” He added that “the name is a total lie. It is not so much related to Java as it is to a common ancestor, C, in syntax.

Eich called the work “urgent work,” but also said that “I knew there would be mistakes, there would be gaps, so I made it very malleable as a language. This allowed web developers to make it what they want it to be.

Why has JavaScript been so wildly successful?

There are multiple reasons, including Eich’s foresight, ease of learning, and code tolerance that would be errors in many languages, such as comparing strings to numbers and getting a common sense result, although Eich later called it “a great regret, because it breaks an important mathematical property.

Another important factor is that Google’s determination to make browser-based applications competitive with the desktop gave the world the V8 engine (2008), which together with Mozilla’s SpiderMonkey and Apple’s JavaScript Core gave the language extraordinary compiled performance. with JIT. In 2009, Ryan Dahl came up with Node.js, allowing V8 to run outside of the browser. Dahl had server applications in mind, but today Node.js and NPM (Node Package Manager) are also essential to the development process for most web applications.

Development process? Part of the problem Crockford refers to is that, along with increased capacity, JavaScript has acquired a lot of complexity and a typical application today includes a build process using WebPack, Rollup, or some other bundler, very far from Eich’s original concept. .

Also, many web developers don’t write JavaScript; rather, they write TypeScript, which it compiles into JavaScript. TypeScript was invented by Anders Hejlsberg at Microsoft, with the rationale that the malleability and lack of security of JavaScript types made it unsuitable for large applications. TypeScript is now the number three language in the aforementioned survey and is proof that JavaScript is not entirely loved. The advent of WebAssembly, a binary format that can be targeted by languages ​​including C, C ++, C #, and Rust, is another innovation that could undermine the dominance of JavaScript.

“JavaScript has exploded in popularity in just a few years and yes, the ecosystem is terribly complex. It’s a recurring gag even among full-time JS developers how crazy she’s gone. None of us can keep up, “confessed one developer in a recent discussion on Hacker News.

JavaScript is evolving with many new features and progress can be monitored here, although compatibility requirements mean that some flaws cannot be fixed and on the other hand feature bloat is a constant risk.

Crockford’s choice to replace JavaScript, E, is an outlier. Created by Mark Miller, Crockford and others, E is an object-oriented language designed for secure computing and, in Crockford’s words, “eliminates many of the bad parts of Java.”

Crockford also notes that JavaScript will be difficult to move, particularly because it is the language supported by every browser for document object model (DOM) manipulation. When asked what can replace him there, Crockford said: “There are two difficulties. First, we don’t have the next language yet. It must be a minimum capacity-based actor language designed specifically for secure distributed programming. Nothing less should be considered.

“Secondly, we need all browser manufacturers to adopt it and at the same time replace the DOM with a well-designed interface. Good luck.”

Leave a Reply

%d bloggers like this: