Hacker News new | past | comments | ask | show | jobs | submit login

No, I think solomatov is saying you can always use the 'any' type built-in to TypeScript. You can always do:

    declare var fancyNewLib: any;

    fancyNewLib('hello');
    fancyNewLib.someCoolFeature = 3;
You don't get any suggestions or typechecking (obviously), but you're no worse off than just using JS in that sense. And you can easily replace your 'declare' with the actual // <reference> tag when you find it or make it, and clean up any errors.



Ah, yes, that's what I'm doing most of the time. But like you said it's no better than using JS directly, haha.


Just changing the file extension from js to ts will often bring out bugs in your code. The type inference will often catch things. Functions that are declared multiple types or that have duplicate parameters, and a lot of other stuff will be caught.


Actually, it's better. If the core of your application has non trivial business logic, it's a good idea to write it in typed way and write ui and other support stuff with partially typed code.


Fair enough and I think with strict null type checking, where null/undefined isn't part of any anymore things would still get much better than with plain JS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: