Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

After a few years with both TS and JS my verdict is that TypeScript definitely helps, but mostly with type-related bugs - with proper testing you don't get many of those.

What I would like to have in TS is a more expressive type system - the current is somewhat basic(e.g. you can't have a Symbol as a dictionary key - interesting given that it's possible in JS. Also you can't mix dictionary fields with regular ones in one class/interface).

EDIT: typo.



The point of type checking isn't so much to prevent bugs in production, but to speed up your development loop by catching many errors before you've even saved your file. Its much faster to see a red squiggly right after you've written a line of code, and fix it, rather than figure out whats gone wrong 10 minutes later looking at a stack trace in your test suite.


Doesn't this 100% on your personal develop workflow? I for one have been forced to use typescript in the past, and am personally very happy that I don't have to anymore.


I don't understand language design or expressiveness but I'm ok with going slow and being restrictive.

I think what we need is a subset of JavaScript, not a superset. There are things we should not be able to do in JavaScript in a web browser because to me that's where JavaScript belongs. I think the whole idea of js on the server or in other kind of projects is very silly. But that's besides the point.

But I agree with your example of symbol in dict. I would be surprised if it isn't already on the roadmap. Have you tried reaching out to the typescript people?


> But I agree with your example of symbol in dict. I would be surprised if it isn't already on the roadmap. Have you tried reaching out to the typescript people?

It's not just on the roadmap, it's in code review/iteration as of last week: https://github.com/Microsoft/TypeScript/pull/26797




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

Search: