Hacker News new | ask | show | jobs
by benawabe896 4491 days ago
I still don't quite understand why anyone would use TS... especially without an IDE.
5 comments

Tooling is a big boon with TypeScript: Go to Definition, Find All References, Refactor->Rename, debug your TypeScript in Visual Studio.

You're right that if you don't use the tooling, TypeScript is of lesser value. Using things like classes, lambdas, modules syntax is still there, of course, and is quite a bit nicer than JS equivalents.

Be careful with that if you use data-binding in your templates, such as Knockout.js . Visual Studio doesn't know the types of your viewmodels, so those templates are not indexed and not subject to refactoring.
Is there no way to specify type of viewmodel somewhere? Ala d:DataContext from resharper?
Enabling rich IDE support is precisely the point of TypeScript and similar enhancements like Python 3 type annotations: Give the computer in front of you enough information to automatically do for you what you would otherwise have to do manually, freeing you up to focus on higher level problems.
And at the same time doing what Java did, abstracting away what is under the hood, so when something brakes. SOL. But this might be good, keep JS for the Pro's and TS for the Joe's?
The IDE makes TypeScript compelling, but it is useful even without the IDE. You can use the command-line compiler to check your code for errors. This is extremely useful if you have thousands of lines of code and multiple developers working on the project.
I have a hard time understanding why anyone would not want to use it.
Because I'd rather have proper types than stringly typed language requiring using a linter and 100% test coverage for avoiding trivial type mistakes.