> Typing helps the most with large, venerable projects
I disagree. I've started using types from the ground up and it helps almost equally at every stage of the game. Also I aggressively rely on autocomplete for methods. It's faster this way than usual "dynamic" or "pythonic" python.
Part of it might be exactly because writing my datatypes first helps me think about the right abstractions.
The big win with python is maybe 2-10% of functions, I just want to punt and use a dict. But I have shifted >80% of what used to be dicts to Models/dataclasses and it's so much faster to write and easier to debug.
Re:Parse, Don't Validate (2019)
by mixmastamyk on Saturday June 26, 2021 @03:30PM
(#27645021)
I don’t need to aggressively rely on tools, they are merely in the background. Perhaps what the earlier post about experience was thinking.
Also, what makes you think I’m not aware of datatypes? Currently working eight hours a day on Django models.
Typing is just another guardrail, it's not a substitute for finding the right abstractions and keeping things simple.
Re:Parse, Don't Validate (2019)
by hardwaregeek on Saturday June 26, 2021 @02:20PM
(#27644434)
I agree but guardrails are pretty awesome. And if people were saying "don't use guardrails, just drive properly", I'd ask why they think guardrails and driving properly are mutually exclusive.
Keeping the code simple, finding the right abstractions, untangling coupling, gets the most bang for the buck. See the “beyond pep8” talk for a enlightened perspective.
That said, lightweight testing and tools like pyflakes to prevent egregious errors helps an experienced dev write very productively. Typing helps the most with large, venerable projects with numerous devs of differing experience levels.