5 ms·
How significant is the adoption of TypeScript? Angular was built with it; React now recommends it too. Is this really the ratification of TypeScript as THE fron
by mikece 7y ago
How significant is the adoption of TypeScript? Angular was built with it; React now recommends it too. Is this really the ratification of TypeScript as THE front-end language?
- jfkebwjsbx 7y agoI think TypeScript already won around a year ago.
- runawaybottle 7y agoPlease be careful with anointing winners, that stops people from exploring and evaluating all the options, and encourages force feeding whatever is “in” into their projects.
- hombre_fatal 7y agoWell, it's pretty clear in this case. Typescript has even more traction and better integration (like VSCode's magical definition fetching) than I think anyone could have imagined. It dominated its reasonable competitor, Flow. It's kind of a freak win. I think we can say confidently that nothing is going to usurp it. Not like any compile-to-JS language has come close even when JS was at its worse. Now JS is so good I don't even know why I'd use another dynamically typed language. We rarely get blindsided by what actually gets traction because almost nothing does. Something that looks like Typescript isn't going to beat Typescript. Something that's more foreign looking certainly isn't either.
- JMTQp8lwXL 7y agoWhat other options are there? All I can think of is Flow.
- toastal 7y agoI mean there's the typed functional set, PureScript, Elm, BuckleScript, Reason, etc., that compete with TypeScript on type systems why compiling to JS while offering better ergonomics for FP-style code.
- JMTQp8lwXL 7y agoThey could be serious contenders only if they coexist gracefully with the rest of the JavaScript ecosystem: e.g., here's this new awesome type system, but oh... You can't use React + Redux + Material UI with it, it's might be D.O.A to a certain segment of engineers since it has no real practical application for solving today's front end engineering problems with them.
- toastal 7y agoFirst off, not everyone likes those technologies for a variety of reasons--and solving a front-end solution a an alternative is valid. Outside Elm, PureScript, BuckleScript, and ReasonML all work fine with JavaScript libraries and have React interop/wrapper libraries already. I may dislike it, JSX is supported out of the box with ReasonML. I think some pain with JS interop could be worth the trade-off for either better types, managed IO, no null by default, immutablility by default, no option for any, exhaustivity, and the list go on--not just as a linter feature or a config option but built into the language.
- james-mcelwain 7y agoIt's important to remember that there are still a lot of front-end folks who aren't interested in application engineering, but still might find these frameworks useful. For those kinds of people, static typing is a harder sell. For anyone else, yeah, they should probably be using TypeScript in 2020.
- deleted 7y ago[deleted]
- ct520 7y agoI adopted typescript shortly after it’s release and went through growing pains in the first couple years. I don’t use it often now. And it ALWAYS comes back to bite me in the butt when doing any decent sized project. If I had to guess time spent fixing things that would have been caught out weights the cons of using typescript
- tnorthcutt 7y agoForgive me, but I’m having trouble parsing this. Are you saying you recommend using Typescript, or not? If yes, why do you not use it often now?
- sk0g 7y agoSounds like they think time spent fighting the language outweighs any pros TS might have, and thus aren't recommending it. Edit: read it wrong, nevermind.
- deleted 7y ago[deleted]
- CreepGin 7y agoNo, he's saying the opposite (as in TS scales better with project size). > time spent fixing things that would have been caught [by Typescript] out weights the cons of using typescript
- irrational 7y agoProbably not. The numbers I’ve seen suggest that far less than 5% (I think it was 2%) of websites use a library like react, Vue, or angular. Of course, you can use Typescript on its own, but if you are using Typescript, chances are you are also using one of the big 3.
- Bahamut 7y agoAren't an absurd number of websites made with WordPress still?
- thanksforfish 7y agoIt's popular. 26%, 33%, or 36% are some estimates. 1. https://managewp.com/blog/statistics-about-wordpress-usage https://managewp.com/blog/statistics-about-wordpress-usage 2. https://trends.builtwith.com/cms/WordPress https://trends.builtwith.com/cms/WordPress 3. https://w3techs.com/technologies/details/cm-wordpress https://w3techs.com/technologies/details/cm-wordpress
- waheoo 7y agoWordPress uses React for its new editor, Gutenberg. Blocks are essentially react components with a bunch of wordpress apis hooked in / around it.
- tmpz22 7y agoThe tooling for Typescript still isn't good enough to claim that accolade. There are still combinations of libraries, linters, editors, and frameworks, that throw opaque errors that will roadblock students and junior developers significantly. Ultimately until browsers can accept Typescript directly without a compilation step it will remain a second-class citizen. Until then, all of Webpack, gulp, parcelJS, problems and inefficiencies are Typescript's problems and inefficiencies. It's not fair - Microsoft and co. have done a tremendous job with the implementation and documentation of Typescript. But the reality exists nonetheless.
- jdxcode 7y agoYou're right the tooling could be better and that TS trips up beginners. Promises trip up beginners as well though but that doesn't mean they're not standard. TS is very, very close to being standard practice. It's already being used by over 50% of JS developers [0]. It doesn't have to be beginner/tooling friendly to be widespread. [0]: https://2019.stateofjs.com/javascript-flavors/typescript/ https://2019.stateofjs.com/javascript-flavors/typescript/
- waheoo 7y agoThis isnt a democracy. 50% isnt the bar for a standard. Thats like saying only 50% browsers can render html so its standard.
- jdxcode 7y agoI never said it was standard. I said it's very, very close. 50% (actually 58.5% of just those that would use it again) is certainly within the realm of critical mass.
- DanRosenwasser 7y agoAny specific examples where you feel the surrounding tooling is falling short?
- 7y ago
- acemarke 7y agoReact itself is written in Flow, but the React team doesn't make any official recommendations as for language or static type syntax to use. That said, a recent survey of /r/reactjs readers [0] showed 50% using plain JS, 48% TS, and only 2% using Flow . Given that the React ecosystem probably has the most Flow users, I'd say it's safe to describe Flow as dead. 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 - Per that stat, it's reached solid adoption in the React community (see guides like the React+TS Cheatsheet [1]) - 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. So, seems like it's going to be around for a while. I wrote up my thoughts last year on my own experience learning and using TS from both an app dev and library maintainer's perspective [2]. [0] https://www.swyx.io/writing/react-survey-2019/ https://www.swyx.io/writing/react-survey-2019/ [1] https://github.com/typescript-cheatsheets/react-typescript-cheatsheet https://github.com/typescript-cheatsheets/react-typescript-c... [2] https://blog.isquaredsoftware.com/2019/11/blogged-answers-learning-and-using-typescript/ https://blog.isquaredsoftware.com/2019/11/blogged-answers-le...
- girvo 7y agoWhich makes me sad: I've built two production systems in Flow, and I found it absolutely delightful, with the caveat that I specifically chose all third party libraries that supported Flow as well. It's type system (and `import type` instead of Typescript's overloading of `import`) was ridiculously powerful, and back then significantly more-so than Typescript. That's no longer the case, of course, Typescript has smartly stolen most of the advantages Flow had, and it has so much more support from the outside world that it'd be silly to use Flow today. On top of that, I think a lot of the momentum of a powerful type system for front-end development has moved (in the React world) towards Reason anyway. Between Typescript and Reason, we're spoiled for choice in building robust front-ends that stomp bugs early and often!
- beart 7y agoTypescript is introducing 'import type', not sure if it works the same way as flow as I've never used that.
- datasage 7y agoFor those interested in static tying for SPA's and Web applications it seems to have won. That doesn't mean everyone needs to use it.
- DanRosenwasser 7y agoI think it's worth clarifying that Vue 3.0 won't require you to use TypeScript. I think the way to think about this is that tooling will ideally improve for a lot of JS devs regardless of whether they decide to use types or not.
- sergiotapia 7y agoI don't get the hype. We wasted a lot of time fighting the compiler and warnings and errors, and then falling back to `any` and by then, why not just use Javascript the way God Himself intended.
- friedman23 7y agoJust wait until you need to do a significant refactor
- sergiotapia 7y agoRefactor? Is that a new microframework?
- pedrocx486 7y agoBecause even "God Himself"* regrets some of his choices in JS. *Depending on who you define as God, the creator of JS?
- deleted 7y ago[deleted]