"The best thing we can do today for JavaScript is turn it off," says Douglas Crockford, creator of JSON.  DEVCLASS

“The best thing we can do today for JavaScript is turn it off,” says Douglas Crockford, creator of JSON. DEVCLASS

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

Crockford made this assertion in an interview last month:

“The best thing we can do today for JavaScript is turn it off. Twenty years ago, I was one of the few JavaScript advocates. Getting nested functions and dynamic stuff together was great. I spent a decade trying to correct its flaws. I had little success with ES5. But Since then, there has been a strong interest in scaling up the language rather than improving it. So JavaScript, like other dinosaur languages, has become an impediment 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, ahead of Python which ranked second with 48% (ignoring HTML, CSS and SQL which are not general purpose languages). It’s an unexpected feat given its origins.

Brendan Eich invented the Netscape language in 1995, apparently in just 10 days. “In May, I had 10 days of hard work, and didn’t sleep much,” Esch said at a dot.JS conference in 2018. And in 2012, Esch told Charles Severance of Computer: “I went to do … a programming language for HTML, for web designers and programmers to use, embedded directly into a web page … not like Java which was a professional language where you could run real code with type declarations , and you’ll have to write in an aggregate fashion.” He added, “The name is a complete lie. It’s not so much about Java as it relates to a common ancestor, C, in syntax.”

Esch described the work as an “urgent job” but also said “I knew there were going to be bugs, and there were going to be gaps, so I made it very flexible as a language. That enabled web developers to make it what they wanted it to be.”

Why has JavaScript been so successful?

There are several reasons, including Esch’s foresight, ease of learning, and code tolerance that may be errors in many languages, such as comparing strings to numbers and getting a Boolean result – although Esch later called this “a big regret, because that breaks An important mathematical property.

Another big factor was that Google’s determination to make browser-based applications competitive with the desktop gave the world its V8 (2008) engine, which along with Mozilla’s SpiderMonkey and Apple’s JavaScript Core provided incredible JIT performance. In 2009 Ryan Dahl created Node.js, which enabled V8 to work outside of the browser. Dahl had server applications in mind, but today’s Node.js and NPM (Node Package Manager) are also essential to the development process for most web applications.

development processes? Part of the problem Crockford points out is that along with the increased capability, JavaScript has gained a lot of complexity, and today’s typical implementation involves a build process using WebPack, Rollup, or some other assembly, far from the original Eich concept.

Furthermore, many web developers do not write JavaScript; Instead, they write TypeScript, which translates to JavaScript. TypeScript was invented by Anders Hejlsberg at Microsoft, the rationale being that JavaScript’s scalability and lack of type security made it unsuitable for large applications. TypeScript is now the number three language in the above survey, and it’s proof that JavaScript is totally unpopular. The emergence of WebAssembly, a binary format that languages ​​including C, C++, C# and Rust can target, is another innovation that could undermine the dominance of JavaScript.

“The popularity of JavaScript has exploded in just a few years, and yes, the ecosystem is horribly complex. It’s a running gag even among full-time JS developers how crazy it is. None of us can keep up,” a developer admitted in a recent discussion on Hacker News.

JavaScript is evolving with many new features and progress can be tracked here, although compatibility requirements mean that some flaws cannot be corrected, and on the other hand feature bloating is an ongoing risk.

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

Crockford also notes that JavaScript will be difficult to change, especially because it is the language that every browser supports for manipulating the DOM (Document Object Model). Asked what it might replace there, Crockford said, “There are two difficulties. First, we don’t have the next language yet. It should be a subject language built on minimal capabilities designed specifically for secure distributed programming. Nothing less. It must be taken into account.

“Second, we need to get it approved by all browser makers and replace the DOM with a well-designed interface at the same time. Good luck with that.”

Leave a Comment

Your email address will not be published.