I agree that Typescript is really a band aid solution at best.
You are trying to put types on top of something that wasn’t designed with types in mind at all and you often end up with some insanely and unnecessarily complicated types as a result.
Take this as an example of mixins which are a fairly common pattern.
It’s not just that but even when you consider some of the design decisions.
To stick with TypeScript and Dart once again, I mean, they both technically have enums which is an incredibly useful data type but the difference between them is like night and day.
And then finally on top of that, because the goal is no longer to compile to JavaScript you can bring in all kinds of useful language features like this which don’t have an equivalent that I know of https://dart.dev/language/extension-methods
You are trying to put types on top of something that wasn’t designed with types in mind at all and you often end up with some insanely and unnecessarily complicated types as a result.
Take this as an example of mixins which are a fairly common pattern.
https://lit.dev/docs/composition/mixins/#mixins-in-typescrip...
Now take a look at the same thing in a modern well designed language
https://dart.dev/language/mixins
It’s not just that but even when you consider some of the design decisions.
To stick with TypeScript and Dart once again, I mean, they both technically have enums which is an incredibly useful data type but the difference between them is like night and day.
TypeScript: https://www.typescriptlang.org/docs/handbook/enums.html
Dart: https://dart.dev/language/enums
And then finally on top of that, because the goal is no longer to compile to JavaScript you can bring in all kinds of useful language features like this which don’t have an equivalent that I know of https://dart.dev/language/extension-methods