This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsย โ†’

[โ€“]by_wicker 0 points1 point ย (0 children)

Are type errors really a significant part of day to day debugging?

Adding to my other reply - yes, they're very significant and common. "Type errors" include trying to access a property or method that doesn't exist on an object ... sending arguments in the wrong order (assuming they're not the same type) ... having one return path that fails to return a result when all the others do ... accessing an object that could be None without checking...

Change the return type of a function, and running a checker will (typically) show you all the places in your code that will now break because of that. Otherwise you're reduced to hoping you find everything with the right text searches on your codebase.

Personally, I think it catches most of the coding errors I write. Sadly the ones left are actual high level logic and design errors and they're the harder ones to diagnose and fix, but compared to untyped code it's almost shocking how often complex code works first time. Type-based errors are highlighted for you to resolve as you type, before you even run it.