I've already talked about how much I love TypeScript in some of my previous posts. It allows me to be more productive, but most importantly - it...
For further actions, you may consider blocking this person and/or reporting abuse
I'd probably go as far as to say that TypeScript may not necessarily be the ultimate "future" for JavaScript and web development, but it sure is the "present".
It shouldn't be. It's a crutch for devs coming from class-based, statically typed languages to JavaScript, lulls devs into a false sense of security in thinking they can hack JavaScript to behave like those other languages and not bother learning prototypes and dynamic types, adds tons of learning curve to and distracts newer devs from learning JavaScript proper, and those classes don't transpile nearly as cleanly (the same is true of ES6 classes, which were largely a concession to class-based OOP devs who couldn't fathom that JS has always been OOP, just not their flavor of it).
You know this reads as "old man yells at cloud"
Meh. I'll still know the only actual typing that matters after TypeScript's disappears in the transpiler, and my production code will be smaller because it's not the mangled garbage that "classes" turn into.
And given the likes that comment is getting, it seems I'm not the only old man yelling at it.
Unless it's performance sensitive code, what's the difference? If the developer time saved and bugs prevented is more than the bandwidth costs and time difference, it's worth it.
Anything that helps prevents bugs is not a "crutch", it's a developer productivity tool. Or correcting the analogy, it is a crutch, so that you don't trip and fall. It's not a bad thing. People make mistakes. Period. Admitting that and trying to prevent those mistakes is not a bad thing. Do you have all the unit tests for bugs that would be caught by the compiler? No? Then I don't trust your code. I don't care if you're Brendan Eich or someone junior.
Except that, in practice, this leads to convoluted codebases which are more difficult to organize, read, and maintain, much like the "object oriented JavaScript" (🙃) craze of the early-mid last decade and the silly MVC-for-the-sake-of-MVC projects it led to (which often, somehow, managed to be less readable than the spaghetti codebases they were refactored from).
This isn't jQuery or Underscore/Lodash which, as completely unnecessary as they are now, were handy convenience wrappers that ended up informing the development of JavaScript's own methods because of their utility.
This is "Can't handle JavaScript qua JavaScript? We got you fam. Feel free to hack at JS to make it behave like the language you wish it were." It's basically everything Kyle Simpson warned about in YDKJS.
Actually, that's not the only source of
any. Some other sources areObject.entries,Array.prototype.includesIMO, always have to keep in mind, that TypeScript's typing is not perfect, and may lead to false sense of security and reliance on TypeScript's suggestion. Best way is to do testings as if it is JavaScript, and defensive programming / validators, when required (e.g. accepting user's input will always need validation).
No where as strongly typed as a true static typing language, e.g. Kotlin/JS.
You have to enable either
// @ts-checkor somejsconfig.json/tsconfig.jsonsettings, as well.No where as convenient as TypeScript's interface IMO. However, a competitor is indeed Flow.
No.
There is no the future of web development.
There are many competing and co-existing futures, some of which may be more or less popular.
And even if it does become overwhelmingly popular for a time, that's only going to be for a time. :)
True
Many approaches to web development would exist as we progress
Companies would just have to use the ones that seem reasonable to them
I wonder what the tc39 folks think about typescript.
They already caved to classes, unfortunately.
While I'm not going to debate the main question of this article, I will go on and describe my experience with TS.
I didn't plan to learn JS or TS. I just "had to", at some point, as my company made some sudden changes.
2 years later, I'm able to write pretty decent TS code, regardless of the frameworks used. However, I can't stand JS. It's a PITA for me to read / write plain JS.
But that's just my subjective experience. Maybe the fact that for many years I wrote Java and PHP code had something to do with how I perceive native JS.
When you got Jsdoc and serious naming strategy, types are a waste of time !
Just invest in code quality and forget typescript.
If I want crosscompile I have haxe/c#/rust/c++ that are more powerful than typescript.
Typescript are made for dev that does not know to write code without compilation...
Not really I would still stick to ES6 convention or future versions due to it being independent and affect a general amount of people who uses it.
I think Typescript have very successfully positioned itself as javascript that corporations and like minded companies prefer as they already like strongly typed C# and Java. Typescript allows JS to compete in similar space.
Have you worked in those messes of corporate C# and Java codebases? Three words: Resume driven development. There's a reason we still have O&G companies in Houston who are using ancient versions of both, often with AngularJS frontends they still haven't been able to migrate away from.
God, I hope not
I certainly hope not, for all of the reasons I gave in my reply to @somedood and more.
I will hand it to tsc for being able to quickly turn a TypeScript mess into JS/ES you can quickly fix.
"Is TypeScript the future of web development?" - no, I sure hope not. If we keep abusing the web for stuff it was never made for, I hope the future will at least be WebAssembly.
Web Assembly doesn't really dictate a language though. That's probably the future of browsers, but not of the development experience, short of adding a compilation step.