6 ms·
What's the view that TypeScript is the modern Javascript?
by tus88 7y ago
What's the view that TypeScript is the modern Javascript?
- IggleSniggle 7y agoTypeScript adoption has been swift and decisive. In 2019, the majority of js developers that take surveys use TypeScript. Edit: Mea culpa. I got my numbers mixed up, or whatever source I thought I remembered just doesn’t exist. 46% in 2018 (state of js) says nothing about 2019, and is not a majority. That 46% is also backed up by a similar survey that npm ran. It’s worth adding though, I think, that js devs benefit from ts type inferencing and IDE support even if they aren’t using it directly
- leeoniya 7y ago> In 2019, the majority of js developers that take surveys use TypeScript. TS is quite popular, but this cannot possibly be representative of the general population of js devs, not even close. it's more like ES6 >> JSX >> TS >> Flow.
- mping 7y agoI don't understand why jsx is in your comparison, although I agree with your assessment. To be clear there are a gazillion Js projects that don't use react.
- leeoniya 7y agoit's a bit anecdotal but React /JSX is still more common than TypeScript (if for no other reason than time on this earth). and both are dwarfed by ES5/6
- IggleSniggle 7y agoWe are writing our React components in TypeScript, so I’m not sure what React/JSX have to do with TypeScript adoption?
- IggleSniggle 7y ago46% was the survey number, so I definitely misremembered the facts. But your comparison here is inevitably necessary, since TS compiles to ES6/JSX, (as does Flow)
- leeoniya 7y agowhat was the survey sample size and how was the sample selected? (46% of 0.001% is still 0%). my assessment isn't what things compile to but what they are authored in.
- deleted 7y ago[deleted]
- IggleSniggle 7y agoGood question. The state of js survey was self-selected, with 20.2k responses. The data is available if you’re interested. The npm survey, on the other hand, was sent to 800k registered npm users and received 33.4k responses, and also found 46% TypeScript usage. I imagine there is significant selection bias in a number of ways. And, while the state of js survey found 46% “have used ts and want to use it again”, the npm survey did not ask about preference. Still, a decent number of responses that I think is pretty interesting, regardless of your own preferences!
- growtofill 7y agoSource on your claim? It was about 50% on last year’s State of JS: https://2018.stateofjs.com/javascript-flavors/overview/ https://2018.stateofjs.com/javascript-flavors/overview/
- macando 7y agoHave you read this article? https://medium.com/javascript-scene/the-typescript-tax-132ff4cb175b https://medium.com/javascript-scene/the-typescript-tax-132ff... I use TypeScript. It's not all rosy.
- tengbretson 7y agoThere author of that article is speaking out of both sides of their mouth. How can they claim type safety has minimal value and simultaneously knock it for missing higher kinded types?
- RobertKerans 7y agoI think a correction is needed here, it's "the majority of typescript developers that take surveys said they used typescript". I'm being flippant, but Typescript is quite popular, that's it, most people who write JS write JS.
- IggleSniggle 7y agoI agree. Correction added.
- trias 7y ago> majority of js developers that take surveys i like that qualification :) most likely typescript is still a very small minority given how large the javascript world is
- Figs 7y agoGiven how fashion-driven the web industry seems to be, my guess is that some new hotness will steal the stage from it in the next few years. I seem to recall seeing tons of posts about CoffeeScript maybe around 6~7 years ago, but it doesn't seem to be very popular any more... Maybe TypeScript will turn out to have more staying power, but my current guess is that something will happen that makes another technology -- probably WebAssembly -- very popular in the next few years and that will kill off a lot of the hype around TypeScript. Then that will itself mostly get killed off by some other technology about 3~5 years after it hits peak popularity, and so on... I could be completely wrong though, of course! Predicting the future is hard. This is just my guess based on handwavey recollection of the last decade and a half of web trends.
- quickthrower2 7y agoTypescript solves the biggest issue I have with using JS which is a lack of a static type system. It however does it in a very pragmatic way, giving the closest experience to Vanilla JS you could hope for. You are not learning a new language like you would be with Elm or Reason etc. It has a powerful type inference system that puts C# to shame in places, and in some places I prefer TS to C#. I don't feel like Typescript is 'hyped'. It is popular because it's damn good. As a programming language alone it could be seen as not too special, but when you see what it's trying to do, get JS developers to use types and not run a mile, then it does a brilliant job.
- siempreb 7y ago> Typescript solves the biggest issue I have with using JS which is a lack of a static type system. Hmm, the biggest problem with JS is types? Are you sure? I rarely had issues with types in JS. With JS I just used my trusty dynamic type checker at specific places in the codebase, and testing coverage of course even more importantly. But with TS, the codebases I see on a daily base are mostly a terrible mess of wrong ideas, wrong libraries, wrong constructs, wrong design principles, tooling hell, etc, etc.. Which is IMHO the real issue with JS/TS. For some reason TS proponents seem to live in a world where 'TS solves everything'. For me TS is just writing 20% more code and regularly needing to use the 'any' keyword to avoid spending hours on getting a basic line of code working. Everything I write non-professionally is not TS, I cannot think of 1 single reason to give myself that burden. The best thing TS has given me is even more jobs. With Agile front-end developers spend at least 1 day a week in the meeting room, now with TS they spend 20% of their time left to hassling with types. It's hilarious. Especially all those managers that have no clue what's going on, why front-end development gets slower and slower.
- pixelmonkey 7y agoI'm the original author of this post. I'd say that it's very unlikely that TypeScript will supplant JavaScript. To quote Crockford in 2008: "Because JavaScript is the language of the web browser, and because the web browser has become the dominant application delivery system, and because JavaScript isn't too bad, JavaScript has become the World's Most Popular Programming Language. Its popularity is growing. It is now being embedded in other applications and contexts. JavaScript has become important. It is better to be lucky than smart." TypeScript is a very smart language, but then, so are Dart, CoffeeScript, ClojureScript. I suspect that if code durability is what matters to you, JS (and the ES evolutions thereof) will have the real staying power. Plus, not everyone is sold on the value of static types, but everyone is sold on the value of JavaScript.
- krapp 7y agoThe web (or specifically HTML) was originally intended to support multiple scripting languages (which is why the <script> tag had a type attribute, which is now deprecated in HTML5.) Unfortunately, things didn't work out that way. I'm hoping that when WASM matures a bit more, and becomes as universally supported in browsers as a javascript runtime, JS just becomes the default language supported by it, not the only one possible. Maybe one day it'll be common to see Typescript run directly in the browser, who knows? >but everyone is sold on the value of JavaScript. Not everyone[0]. [0]https://news.ycombinator.com/item?id=11447851 https://news.ycombinator.com/item?id=11447851
- james_s_tayler 7y agoI feel more sold on the ubiquity of JavaScript more than the value of it. I feel sold on the value of TypeScript.
- blondin 7y agonot sure Anders/microsoft wanted to replace javascript with typescript. the problem is this imo. to use javascript -- or say python -- in an corporate/enterprise environment, you need to analyze your code base. static analysis is what worked well and still does but you need types. ofc having types has other major benefits but this is the big one for me at least.