Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If JS would have a useful implementation of Prototype-based OOP, we wouldn't need to implement class-based OOP on top of it.
-
@metamourge Probably. TBH I never worked with any other prototype-based language. But since we _can_ implement class-based OOP (in fact quite easily), there's absolutely no reason to have a transpiler for it.
-
@irene Was gonna write that, but it's past midnight here so I consider it a success if I only made that mistake (apart from drinking a coffee at 9 PM)
-
TS also adds static types, imho that's probably the best thing about it. Waaaaaay easier to work with.
-
musician6656yJust goes to show that you have no idea what problems typescript is solving.
Sure you can do the whole oop thing but you can also completly omit classes and go for a more functional approach which works very well and reduces the boilerplate by a huge amount. -
I've tried typescript and I admit that it's very convenient. However, most of its functionality can be replaced by the interface implementation from Pro Javascript Design Patterns (optionally extended to support properties), any class definition you see fit and proper naming conventions.
Related Rants
There's plenty of literature about how to emulate classes and interfaces flawlessly in JS even without es6, but no, let's make a separate language using 20 extra keywords and several unnecessary concepts called TypeScript with its own compiler.
rant
js
oop
typescript
reinventing the wheel