Should We Replace JavaScript?

It is undeniable that JavaScript has progressed drastically over the last 10 (or 15) years. In the 2000s, the version of JavaScript was dated and it took almost a decade for us to see development in JavaScript as a language. JavaScript enjoys a very active community that keeps pushing the boundaries of what can be done with JavaScript. Moreover, JavaScript has grown to be a top language even though it was born in the browser to make dynamic pages and was considered a toy language for a long time.

Douglas Crockford has repeatedly mentioned that he would like to see something new over JavaScript. In some instances, I completely agree because JavaScript should not be the last programming language standing on the web. The community should push to have better languages and see if we can get alternatives to JavaScript in the browser itself. In the 2000s, Firefox planned to include Python with PyXPCOMExt in the browser which would make a compelling alternative language that is also easy to use as JavaScript. I also remember VBScript which was a Visual Basic version from Microsoft to work in Internet Explorer as a competitor for JavaScript in teh client-size. But, did not work out because other browsers never implemented it and we are glad that it didn’t happen because JavaScript was a better language

Love and Hate

JavaScript has a weird relationship with developers. Everybody loves and is very protective of JavaScript and most of them hate writing vanilla JavaScript. If you are new to web development, you don’t know about CoffeeScript, Flow, LiveScript, Dart, and a lot of other languages that are compiled into JavaScript. But, you have at least heard of TypeScript. This constant search for a better JavaScript tells me that even when the community is protective of this language, at the same time, not many people like writing vanilla JavaScript.

As the browser has become an operating system that runs applications, it would be nice to have multiple languages serving as alternatives to JavaScript. The language has gone beyond expectations but we could do better. We can have a language that implements what we have learned about the web over the last 20 years. The web of 20 years ago is completely different from what is today as we use the web for almost everything. When designing JavaScript, I don’t think Eich had an idea of what the web would look like in 30 years. Also, considering that the language needs to be backward compatible, there is a lot of baggage carried for over 30 years of web development in an environment that you cannot break anything previously made.. DHTML must run in modern browsers like we were in 1998. That is one of the reasons that we love the web. But, it is also a reason a language like JavaScript cannot evolve as we would like. It is virtually impossible to replace the dated DOM APIs with modern ways or improve them without breaking things. I would love to see what a modern DOM API would look like while divorcing from the Java-like implementation of the 90s when the world thought that Java was the only future.

I know that there are issues with trying to add another language. First, the community is protective of JavaScript and that is one of the reasons Dart did not make a big difference in the web. Nevertheless, those “good intentions” by some companies trying to design a new language could create a monopoly within the browser. We don’t want to depend on Google’s decisions of what features the language should have. This would be catastrophic for the web as they will always pull for the benefit of the company and not the community. We can see something similar to Apple’s engine and how other engines are not allowed within iPhones even after these many years.

Conclusion

To conclude, the web today is not the same as its early years. It would be hard to think that the same language will be dominating for many years to come considering that a lot of professional developers are just avoiding JavaScript and using other languages that compile to it. JavaScript is part of the web we know and it will never die. However, it would be nice to see alternative languages that can innovate and even inspire JavaScript to become a better language. The problem: too much has been invested in to JavaScript and the resistance to change by developers that even when they don’t like the language, it is so simple to hack that they use it anyway. Thus, the only way to move away from JavaScript is having new generations of developers work on other technologies.

Teylor Feliz
Teylor Feliz

Teylor is a seasoned generalist that enjoys learning new things. He has over 20 years of experience wearing different hats that include software engineer, UX designer, full-stack developer, web designer, data analyst, database administrator, and others. He is the founder of Haketi, a small firm that provides services in design, development, and consulting.

Over the last ten years, he has taught hundreds of students at an undergraduate and graduate levels. He loves teaching and mentoring new designers and developers to navigate the rapid changing field of UX design and engineering.

Articles: 188