by garganzol · 3y ago · 0 comments
JavaScript is a cool dynamically-typed language though. C# is on another side of the spectrum: it is super cool by being fully strongly-typed. But TypeScript is something in the middle and this uncertainty gives pains.
Not really.
For personal projects or if you're a freelancer sure. Once you work in a company/startup you can't go and implement things in whatever you like.
It's way easier to convince any manager that Dart/Flutter is a good choice for a mobile app because of the tech advantages than in anything else because of the pool of available developers.
Standard library that isn't worthless - no more npm package spam.
Type knowledge in the runtime. It doesn't have to be typed, just make it so I don't have to do crazy checks on properties before casting to a class.
Imports without webpack.
You do have 'instanceof' at runtime, so unless you mean some other type of 'class', casting to a class is really a non-issue (and you don't really 'cast'... since dynamic typing and all). If you mean some more advanced concept (e.g., structural type runtime checking), think how you would do it in statically typed languages (is it really better?).
function Foo(s) {
this.s = s
}
Foo.prototype.bar = function() {
console.log(this.s)
}
const baz = new Foo("Baz")
baz.bar()
But it seems Typescript can't handle it?This is exactly what bugs me about TypeScript. The language itself is fine—some annoying things, but generally they’re due to having to run on top of JS. But Microsoft had the chance to fix JS’s terrible standard library. And they didn’t!
I know that's less of a concern nowadays with modern http, but guess who still supports ie11
It feels like terrible advice to give someone, given ESM is far superior to AMD, and this would be going backwards in time, but in your case you are already blighted by the disease and it is advice that might staunch some of the bleeding.