3 ms·
Most of that not gonna happen by ts ideology. But the reason why people need that is unclear to me. Typescript already is 99.9% typing improvement over javascri
by wruza 4y ago
Most of that not gonna happen by ts ideology. But the reason why people need that is unclear to me. Typescript already is 99.9% typing improvement over javascript. Chasing that 0.1% out of pure perfectionism makes one an enemy of the good and of themselves.
Please remember that these extends keyof and co were included in ts not because it’s so super cool with types. They are there to cover common dynamic patterns of existing js codebases and standards. You don’t have to make same mistakes again, and definitely aren’t expected to make this problem worse. There’s already enough popular projects with perfect multi-page meta-type gibberish instead of plain human-readable types. Which wouldn’t require rust-tsserver running on a supercomputer in the first place.
- ajkjk 4y agouh... people want them because they run into pain points every day, in a project that's actively developing and can solve those pains. Why wouldn't people want their pain points solved? They're not, like, rare issues. They happen every day, or at least every few weeks. A month can't go by without my putting up a code change that has "unfortunately, TS doesn't support this, so <workaround>" in the description. I love TS but it can certainly be better. edit/afterthought: I just do not care about JS-compatibility per se. It's a nice guideline but I'd like the language I use to be as good as possible, because I'm trying to use it to do things, regardless of their ideology.
- wruza 4y agoWhatever they do, you’ll still have pain points, because people tend to ignore the good and focus on what’s left, and what’s left is never zero for that’s how the universe works. Gods run into pain points all the time. The correct question is not where our pain points are, but how far these pain points are from what we want to do, i.e. are these points a real pain or just our own perfectionist anxiety. Typing for the sake of typing may not help doing the job before thursday.
- ajkjk 4y agoYeah but when you fix this round of pain points and then people complain about the next one... then that means I got a bunch of improvements? Is your point "because you'll still have pain points after improving things, don't improve anything?" that makes no sense. In no sense are the issues with TS "perfectionist anxiety". They're real, fixable problems that make it harder to write safe or simple code.
- ptx 4y agoIf you don't care about JS compatibility, that opens up lots of choices. Many languages compile to JS and interoperate without being constrained by syntax-level compatibility. Kotlin [1] is a nice statically typed language, for example. [1] https://kotlinlang.org/docs/js-overview.html https://kotlinlang.org/docs/js-overview.html
- ajkjk 4y agoTS is way better than Kotlin, imo. At least last I checked. I mean that I don't care about JS compatibility _exactly_. I still want to write JS, just with all the problems... fixed.
- mpoteat 4y agoYou'll have to pry my meta type garbage out of my cold dead fingers. :) I agree with you - while neat types are cool from a mathematical perspective, they impose a huge maintenance burden. Most times, it's much smarter to accept a bit of type unsafety than to try to achieve perfection. Pretty much the only exception is in library code where you can use advanced types to provide improved developer experience or prevent user error.