I really don’t get how the static type in Typescript leads to more typos and why is that a cause of stress more than any other typo errors?

IDEs point out the vast majority of typos and the only other thing that you need to do when working with a static type language is … you know … declaring the types. That’s it. And there aren’t all that many: number, string, boolean and the null/void/undefined.

And in practice, any typo is glaringly pointed out before you get a chance to run the code, as opposed to a typo in a dynamically typed language where you declare and assign a variable then start wondering whether later in the code you used the wrong name, somehow got assigned a different type later on, etc.

Also changing types as allowed by dynamically typed languages is considered bad practice in most of them (I have 14 years of PHP behind me, I guess for about 12 of those I wished for static types or at least mandating the declaration of variables before their use instead of boiler plating my way ahead — ironically enough IDEs had the option to enforce practice from day 1, making it a requirement throughout teams in a big project was a different challenge.).


Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store