3 ms·
I don’t see the need for TypeScript. A lot of people seem to see dynamic typing as this big bad thing that should just go away. I haven’t used JS professionall
by pipeline_peak 4y ago
I don’t see the need for TypeScript. A lot of people seem to see dynamic typing as this big bad thing that should just go away.
I haven’t used JS professionally so maybe I don’t know any better, but I think dynamic typing should be embraced. There are A LOT of applications where you really don’t need to worry about types. And from my experience working with app/cloud code bases in C#, I’ve seen a lot of ugly classes that I can’t touch simply because they were written 10 years ago and I don’t trust them. My guess is the web world is plagued with all sorts of old code you don’t want to touch, I don’t think TypeScript solves that with static OOP.
I think the prototype based OOP approach in JS is better because you don’t have to concern yourself with all these hierarchies. You can have multiple car object definitions with dynamic typing, it doesn’t matter because it’s all about what’s being used in the moment. In static typing we expect a single concrete definition to be extended, composited, and reused in an intricate way. That way never works because what is defined today as “just the bare minimum” mutates into something larger and now everything inherited “needs” it too. But they don’t always truly need it, they just have to satisfy some argument. And of course that “single” definition gets duplicated across the code bases anyway. Initially we think of these approaches as elegant, but it almost always rots in its own hierarchal casket.
Dynamic typing allows cleaner OOP and its approach is more honest. “I need a representation of this abstract type right now”, not that type and a whole bunch of other crap that it’s fundamentally forced into bringing along for the ride.