Hacker News new | ask | show | jobs
by mixmastamyk 1820 days ago
Adding lots, no. I agree with the grandparent.

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.

2 comments

> 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.

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.
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.
Exactly. To be clear I’m very pro-type systems.