3 ms·
Docstrings are great until you change your mind about something fundamental. Once you make that big scary change you might have to rerun your unit tests dozens
by __MatrixMan__ 4y ago
Docstrings are great until you change your mind about something fundamental.
Once you make that big scary change you might have to rerun your unit tests dozens of times before you've found and fixed all of the bugs that your change caused.
A static type checker, plus a bit of foresight and diligence, will give you a much more complete view of the carnage up front, so that you have a good idea about the cost of making that change while it's still cheap to decide differently.
And the best part is that with python you can only bother with the type hints where you need them (e.g. at the boundaries between teams)
- mharig 4y agoNever experienced that. Maybe you should make your code more modular.
- __MatrixMan__ 4y agoI agree with you there. The experience I was thinking of here involved taking a codebase which wasn't modular enough and making it modular. So the "big scary change" involved changes to the module boundaries (which are the only thing I bother with type hints for anyhow).