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

My issue with TypeScript is that it simultaneously has some complex features that result in types that are hard to follow and yet it also lacks simple abilities like creating a type for a number within a certain range. I end up wanting to use Joi to further validate the types, not because I need runtime validation, but just because it's significantly more thorough and in some cases easier to read, too. But then I end up with a lot of duplication between Joi and TypeScript. It holds a lot of promise but there's too much friction there.



Supporting static range types is crazy hard. Only full-on math languages like Idris can do that. If you need runtime checks and types without duplication use something later like zod or io-ts. They can derive ts types automatically




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: