I don't understand TypeScript
2016-04-29Last modified on 2021-05-24
Here are a few personal thoughts about my interactions with the TypeScript world.
The representation we have of TypeScript is wrong
TypeScript is actually compatible with 60% of ES6:
Even the current page of the french wikipedia is misleading about the reality of TypeScript:
Is supports the ECMAScript 6 specification.
TypeScript is not a standard
At Devoxx, I heard that «TypeScript also embeds features from the future ECMAScript specs, add types, and it will become the standard».
Maybe, but not for now and the next few years.
The evolution of the ECMAScript specifications is a process that takes time, with multiple people involved (TC39). The evolution of the specification is not handled by a single authority (like Microsoft with TypeScript) to define the next versions.
The output file is plain JS, matching a version (ES5, ES6) that you will define.
So, all this extra-typed-sugar for nothing ? Yep.
Using TypeScript is currently only sugar in your IDE, and I am not found of the idea of choosing a specific language for that.
Is it for me ?
I don't think so.
Maybe TypeScript can make onboarding of junior developers understand how things are structured in a big project.
This was a punchline from this talk:
People coming from C# or Java won't be lost !
Look at this example from Angular 2:
It's like... Java.
But, how can you code without types ?
You can beat the averages with a dynamically typed language...
Since the typing is optional in TypeScript, the debate about types is another story :p
Will TypeScript really win? And why Dart wasn't able to win ? Only the future will tell us.