Skip to main content

The rumours of death of JavaScript are greatly exagerrated

Interesting developments in TypeScript community. Another open source project announces return to plain JavaScript. Another flame war begins. People are angry and upset that JavaScript refuses to die ;-)

https://devclass.com/2023/09/07/ruby-on-rails-creator-removes-typescript-from-turbo-framework-upsets-community/

Source: https://endjin.com/blog/2017/01/is-javascript-still-dead

Programmers forget that our art, creative as it is, is not the same as that of Michelangelo. Unlike his eternal works, ours exists only to facilitate other more important things: education, business, work, leisure etc. Our technological choices must be therefore pragmatic, not emotional or ideological. That includes the choice to use TypeScript or not. Mr Hansson carefully weighted it for himself and concluded that:

“TypeScript pollutes the code with type gymnastics that add ever so little joy to my development experience, and quite frequently considerable grief. Things that should be easy become hard.”

I was an enthusiastic adopter of TypeScript already in 2014, with my own pragmatic reasons. With strong C# background I felt at home with TypeScript. Yet I didn’t care much about typing annotations. These are often named as the most important benefit. I was much more excited about such indispensable features as proper OOP, enumerations, arrow functions with correctly working this, constants, static classes or asynchronous functions. Everything what was sorely missing in the rusty ECMAScript 2009 standard of the day.

Times have changed. With the advent of rich web UIs JavaScript evolution got a boost and is accelerating ever since. We’re at ECMAScript 2023 today. Go and see that rumours of JavaScript’s death are as exagerrated as rumors of imminent demise of the greenback: https://github.com/tc39/proposals

Apart from interfaces, everything else is available in JavaScript since long time. Heck, even controversial decorators made it to TC39 Commitee’s Stage 3! Type annotations are coming - although with JSDoc and lint combo working like a charm, I barely see the point anymore. All that’s left is, like Mr Hansson puts it succintly, “little joy and considerable grief”.

But that’s how it works for me. Does strong typing solve real concerns for you? Does it makes things significantly easier than they would be otherwise? Go for it, and don’t look at what others do. Be a Pragmatic Programmer, which BTW is a title of an old but excellent book as well: https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/.