3 ms·
Ignoring the tech side for a minute, my major problem with TypeScript is that TS proponents assume that the static vs. dynamic debate has been settled. That the
by deckard1 7y ago
Ignoring the tech side for a minute, my major problem with TypeScript is that TS proponents assume that the static vs. dynamic debate has been settled. That the future is static typing, and that people have to be crazy for wanting to do dynamic typing in a dynamically typed language.
A great many developers have found themselves having to write JavaScript because that's where they got pigeonholed. Then, because they'd rather be doing Haskell, Java, or whatever, they bring that crap to JS and enforce it on developers that possibly liked doing regular JS.
Type inference is older than I am. Yet you would think this is some new technology. When in reality, we could have had it on Ruby. On Python. On Perl. And on Lisp. Decades ago. It's not new and it's not special. But it certainly has a lot of undeserved hype at the moment.
There is no conclusive proof static typing reduces bugs. This is some weird myth that keeps circulating. The trend pendulum will continue swinging though. TS won't be immune.
- thawaway1837 7y agoI don’t see how you can claim that TS believes the static vs dynamic debate is settled when TS already includes, and continues to add features that enable and make it easier to dynamically type stuff (for example, unknown is a fairly recent addition). In reality, the reason TS has been so successful, and likely will continue to be so successful (until they screw up the execution, or forget what made the language so successful) is thst TS is an entirely pragmatic language. It uses theory not to decide its roadmap, but rather, uses actual problems and needs faced by JS developers to decide the roadmap, and then uses type theory and other CS concepts to solve those problems. For example, the reason TS uses Types is not because a group in MS decided that static typing is better than dynamic typing, and what JS really needs is a layer of types above it (that was coffeescript...). Typescript was created because MS wanted to make better IDEs and tooling for JS (specifically, they wanted to bring Intellisense which is a huge VS selling and marketing point, to JS) and they realised they couldn’t do that without adding type information to JS. Hence, a practical need drove the decision to create TS.
- jammygit 7y agoIDEs aren’t that necessary if you have strong command line skills. The only ide feature I really miss is autocomplete because it’s a pain to remember method names
- addicted 7y agoMy IDE is Vim/i3/bash. So the IDE stuff isn’t extremely advantageous for me. But that’s the reason Typescript was created. A convenient side effect of that for me is that I can manually use the same clues an IDE used to understand the code base I’m working on easier, faster and with more confidence than I would be able to in a vanilla JS project.
- kortex 7y agoIgnoring runtime bugs, static typing and type hints gives me (a) autocomplete that works better (b) near-real-time linting that lets me catch dumb bloopers before my focus shifts to a different zone (c) lets me inspect objects/signatures and get up to speed on other people's code way faster than having to look up docs. This alone gives me a huge productivity boost and I can't imagine working without it. It just so happens that anecdotally I see runtime errors inversely frequently to my discipline with using hints (go > python w/ hints > python w/o hints). I like having some wiggle room for rapidly hacking stuff out. interface{} and Any are nice in small doses. Namely as parameter types and only when I'm the only one using the code and just need to ducktype my way through something.
- deleted 7y ago[deleted]
- Rapzid 7y agoThere is recent research on display in TypeScript with regards to practical inference and flow control analysis at interactive speeds.