upvote
I like the strutural typing as well. But I hesitate to use TypeScript because AI tells me this:

It Catches: Mismatched function arguments, missing object properties, and typos in variable names.

It Misses: Invalid JSON from an API, unexpected database outputs, and bad user input.

reply
You use Zod if you want runtime features. I'd say it's pretty industry standard. On the type level there's no reason it couldn't account for any of the examples you pointed out. And since Zod supports all the expressiveness of the actual language, you can certainly have those as runtime checks

I would also just like to point out that the "It Misses" your robot pointed out aren't actually flaws with TypeScript but flaws with JavaScript.

reply