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

Does Typescript offer a strong type system?



Yes


What's your argument here? For example, Typescript allows lots of operations on objects that cannot be known at compile time because it relies on the user to inform it of types accurately, anything can be coerced into anything without complaint with "as", and it allows for arbitrary operations on an "any" type without complaint.

I've heard it referred to it as an "optionally typed" or "gradually typed" system, which, having worked for years in Typescript and other languages like Rust and Kotlin, etc, I agree with.


Pretty easy to add runtime validation at the edges with Zod https://github.com/colinhacks/zod

Great thing is that the zod schema also doubles as your typescript type so you don't have to write a duplicate/shadow TS type definition.


That doesn't make Typescript as a language "strongly typed".




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: