The Shocking Secret About Static Types
Eric Elliott
3.5K90

Great article, but I think that the question is the wrong one. Although there is some correlation between static typing and the reducing of bugs, I don’t think that bug reduction is the biggest argument for using TypeScript or another statically typed language.

I completely agree that TDD is the way to go for reducing bugs, but that is an development approach, not a language, so we are really comparing apples and oranges here.

Going with TypeScript over directly coding in JavaScript, for me, has much more to do with code maintenance than it does with directly reducing the number of bugs. And that, in turn, reduces the actual number of bugs.

Sure TypeScript can be coded to be a complete mess just like any other language, so there is no guarantee, but in my expreience, it is easier to create a mess with a weakly/dynamically typed language than with a strongly/statically typed one.

So… TDD combined with a code base that is easy to maintain is the best approach to reducing bugs. And, at least for me, that means using a strongly/statically typed language.

Like what you read? Give Gregor Dzierzon a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.