A huge segment of the community pushing static typing use the “You don’t need as many tests!”
Francois Ward

I hope people would adopt the mindset that “Static typing frees your time up to write more interesting tests!”

I’ve recently started programming in Python for work after spending many years using C#. For my first production Python script, I wrote a pretty exhaustive set of tests that gave me 100% block coverage for my script which was only about 1–2 pages of code. In addition to finding real logic bugs in my code. I found tons of silly typos, that would have been highlighted in my IDE as being errors or type issues if I were using C#. This is why I wanted to hit 100% block coverage. I didn’t want a typo to cause a blown up in our production environment.

In C# I would not have written as many unit tests or hit 100% block coverage, because I would have not been as paranoid knowing that the silly mistakes would be caught up front. I also would probably have missed some real issues because I didn’t go the extra mile to hit 100% block coverage as well. So static typing I think can give you a false sense of security.

More typing should enable more deep testing!

Like what you read? Give Daniel C Wang a round of applause.

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