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

I strongly disagree. A well structured project which is broken up into meaningful modules with good separation of concerns and where each significant module is tested in isolation; that kind of project does not need TS.

You don't need to do type assertions with JavaScript; in the tests you may need to assert that certain properties exist but only to the extent that this property is relevant to the test case. This is purely a logic concern, not a typing concerns.

Types are just labels which try to make sense of reality so it makes no sense to assert their correctness.




Any project of sufficient size will have warts. Python added type checking after Guido saw how hard it was going to be to port Dropbox's 2mil LOC codebase to python 3. There is a reason the two most popular dynamic languages have added a type system.


There is also a reason why Java lost popularity. People think that languages like TypeScript are somehow different, but they're not. TypeScript encourages exactly the same patterns as those used in Java. Mark my words, it will suffer from exactly the same problems. It will just take a few years for people to realize this.


Comparing the type systems of Java and Typescript shows a lack of understanding of the differences between them. Modern type-safe language have numerous things that Java never had and probably never will.

Any project of size will need types. Either they will be explicit (static typing) or the project will be riddled comments, tests, assertions, and bugs.


The tests asserting certain properties are just type checks, albeit weak and less-safe ones. If you have to make sure a property exists then that is 100% not a logic concern. It's a check on the structural integrity of the module.

You can eliminate a whole group of tests in TS that you would otherwise need in a JS project.




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

Search: