4 ms·
I'm not sure why you're talking about "object oriented". TS, in and of itself, has nothing to do with OOP. You can write functional-oriented code in TS same a
by acemarke 7y ago
I'm not sure why you're talking about "object oriented". TS, in and of itself, has nothing to do with OOP. You can write functional-oriented code in TS same as you would in JS. TS doesn't mandate use of classes or anything like that.
As an example, I can write a React+Redux app in TS, and be writing 100% plain functions (components + reducers) the entire way through.
From my viewpoint, TS has more than hit enough critical mass to survive for the long term:
- Microsoft is heavily invested in its ongoing development
- The Angular community requires use of TS
- The React community has split in general between types and no types, but a recent survey of /r/reactjs readers indicated ~50% of React devs are using TS [0]
- Where CoffeeScript introduced new syntax entirely, TS's focus on being a superset of standardized JS means that there's both less to worry about compat-wise _and_ it can be seen as a way to use new language features instead of Babel
FWIW, I wrote up my thoughts on learning and using TS as both an app dev and a Redux maintainer [1], and I'm sold on using going forward.
[0] https://www.swyx.io/writing/react-survey-2019/ https://www.swyx.io/writing/react-survey-2019/
[1] https://blog.isquaredsoftware.com/2019/11/blogged-answers-learning-and-using-typescript/ https://blog.isquaredsoftware.com/2019/11/blogged-answers-le...
- orange8 7y agoOOP is not just about using classes, just like functional programming is not just about using functions. They're different programming paradigms, each with their own patterns, strengths and weaknesses. Idiomatic TS favors an OOP style, which is why there are event libraries out their [0] whose sole goal is to enable using TS the functional way. > The Angular community requires use of TS Angular was once the king of the JS frontend, but now it has more or less been reduced to a certain niche in the market. It is no accident that it is very popular among those with a Java background, with Java being a very good example of a static OOP language. > The React community has split in general between types and no types That split is being caused by TS. This is not a good thing for the eco-system as a whole. The idea that everyone will be forced into adopting TS because of the power of MS is the very idea that will lead to a backlash, just like the backlashes against XHTML and Java applets. [0] https://github.com/gcanti/fp-ts https://github.com/gcanti/fp-ts