5 ms·
I like Java but I think the right job for all jobs, if you're going to pick one, is TypeScript: - At this point you can say TypeScript is mainstream. It's not
by dmitryminkovsky 5y ago
I like Java but I think the right job for all jobs, if you're going to pick one, is TypeScript:
- At this point you can say TypeScript is mainstream. It's not Java, but it's definitely not a niche toy.
- Many companies stand behind it and use it in production.
- It is widely supported by tooling.
- With TypeScript, every element of your stack can not only share code, but can share types, too. This has been a huge boon for me.
- The type system is really, really flexible. It seems possible to specify the exact degree of safety that you want for any given situation. I never feel bound by the type system. It's very liberating. Not so with Java or C#.
- It compiles to JavaScript, so it can run anywhere. On the backend you can run it natively with Deno. I haven't tried this yet, but am looking forward.
- ingframin 5y agoThe world doesn't end with web apps. I use Java a lot for event based simulations and for heavy math and it works like a charm. I don't think I can easily replace it with Typescript to be honest...
- MangoCoffee 5y agoaccording to Dice, TypeScript projected to do well in 10 years with increase pay and trending up. https://visualstudiomagazine.com/articles/2021/04/01/typescript-csharp.aspx https://visualstudiomagazine.com/articles/2021/04/01/typescr...
- dtech 5y ago> - The type system is really, really flexible. It seems possible to specify the exact degree of safety that you want for any given situation. I never feel bound by the type system. It's very liberating. Not so with Java or C#. Personally this is why I believe all languages will converge into the structural, gradual typing model of Typescript.
- mrkeen 5y agoAs a hardcore fan of static typing, how would you convince me to use a gradual typing model?
- drost 5y agoGradual typing gives you the option. You can be as statically typed as you want. Dart is gradually typed. So when I'm writing some flutter code, I may not know when types I need in the moment, I can omit type signatures until I work that out then write my types and go back to update the code.
- dmitryminkovsky 5y agoI wouldn’t. My experience with Flow and Typescript is that the incremental adoption bit is misleading. It’s a hook. It’s possible, but you’ll quickly come to resent your JS code and go all in. That process will get you through most of the learning curve and that’ll be that.
- runninglate 5y agoHow do you type something like the groupBy function in TS?
- dtech 5y agoWhich language do you work in? I can promise you that Typescript can type things way more strictly than your language, unless it's Julia. Typescript allows you to not make typing very strict when it's not important, but also allows you to define things stricter than your average Haskell codebase. Most other languages have only 1 option about how strict a piece of code is typed.
- mrkeen 5y agoMy situation is: I statically know the types of things at compile time. I'm not sure how to 'define things stricter than that'. My question was: what benefits would I get from sometimes not knowing the types at compile time (which is what I guess gradual typing is)?
- pjmlp 5y agoSure if you are happy to struggle with V8 performance.
- dmitryminkovsky 5y agoYeah I hear you, but I think the pros outweigh the cons. For one thing, I have never run a stateful V8 container, which makes scaling trivial (if the performance issue is actually just V8 and not some greater architectural defect). V8 performance issues can be overcome, and it’s not like the JVM is trivial to tune. Every workload has a learning curve.
- pjmlp 5y agoI hardly ever had to tune JVM, and would never put the single threaded V8, with a dynamic language, under similar workloads.
- hawk_ 5y agoConsuming more and more energy to do the same computation isn't environmentally friendly either. Just because you can scale by throwing more CPUs at the problem doesn't mean we should.
- TranquilMarmot 5y agoAssuming problems are worth the energy usage in the first place :) How many Java apps do you think are out there that are not even worth the energy that they're using to run? How many absolutely asinine startups selling DRM-controlled juicers or internet connected water bottles or NFTs? I'm not saying that every project that runs on Node or Python or whatever is worth the extra energy it uses, but this is kind of a silly argument to make with the kind of stuff coming out of the tech industry these days.
- kaba0 5y agoThe JVM is actually the most “eco-friendly” out of the high level language platforms.
- TranquilMarmot 5y ago> every element of your stack can not only share code, but can share types, too We have auto-published types generated from OpenAPI specifications that we use in a lot of different projects and it's been really awesome.
- dmitryminkovsky 5y agoYep, I am doing the same w/ types from a GraphQL API. It's wonderful. The entire stack's types are coupled to the Postgres schema. Postgres -> Hasura -> GraphQL -> generated types. <3
- lmm 5y agoDid you ever try Scala? It has great client-side support (likely better than TypeScript's server-side support), and the type system has the soundness of Java/C# but is flexible enough to cover all the reasonable use cases (at least once you include shapeless), as can be seen by the fact that even enterprisey Scala code doesn't have to rely on magic annotations anywhere.
- cies 5y agoScala tries to do too many things: both Haskell and Java, both backward compatible and radically new... It just does not fit together. Want functional? Go with Haskell/OCaml/ReScript/etc. Want JVM compatibility-and-thus-OO-at-the-core (possibly with some functional goodness on top)? Go with Kotlin.
- adav 5y agoAll popular languages seem to try to do too many things. Scala just seems to have achieved more than the others and has became infamous for it. Just like any language, just use the bits you need for your project and apply KISS (Keep It Simple, Stupid) liberally! :)
- dmitryminkovsky 5y agoNope! What magic annotations are you referring to? In Java?
- lmm 5y agoYeah, I've found that any large Java codebase tends to use a lot of annotations (e.g. Spring, JPA, JTA, AspectJ, JAX-RS) to do things that would be too cumbersome to do within Java proper - the annotations tend to be "magic" in the sense of doing something that breaks the normal rules of the Java language.
- zmmmmm 5y agoI'd love to go all in on something like TypeScript but as long as it's backed by a runtime without true concurrency it can never be "the right tool for all jobs". Same problem with Python which I would also like to embrace but ultimately always have to complement with something that can do real multithreading.