DEV Community

Discussion on: No, TypeScript is not OOP version of JavaScript

Collapse
 
macsikora profile image
Pragmatic Maciej

First was typo, thanks for the comment. I meant exactly what you wrote, that it doesn't mean that TS has anything to C#.

people think Typescript is for objective oriented javascript because that's how it was sold to a lot of people originally.

Maybe they did, but the language has 8 years already and has changed and is changing. You cannot do comparison based on what was in the language before. I am talking about now, not 2012.

The fact that Javascript has classes now doesn't negate the fact that Typescript encourages them more than plain javascript.

I am working with functional TS for more then three years already, I don't see any encourages from TS to force me to do OOP. I wrote classes in TS only because React was enforcing them before, no fault from TS side.

If it's harder to do Functional Programming in Typescript

As I said in the article FP in TS is harder, agree, but it is out of point that TS is more object oriented, it is not. TS is constantly evolving and there are many concepts which will make FP simpler. But even now, you can write functional code in TS, if you say there is no for example HKT, ok Elm also doesn't have them, but its still purely functional language.