Static or dynamic typing for small scripts: where do you land?
For big projects I'm firmly in the static typing camp. But for a 50-line script that renames files or pulls some data from an API, types sometimes feel like ceremony.
Then again, half my "quick scripts" end up living for years.
Do you type everything from the start, add types once a script grows, or never bother for small stuff?
Comments · 3
Type hints in scripts are underrated. Even light ones give you editor completion and catch mistakes. They're optional, so add them where it pays off.
Quick scripts become production code more often than anyone admits. Add types the second time you touch one.
For 50 lines I just go with whatever's fastest. If it survives a month, I tidy it up. Types arrive on day 31.