5 ms·
> My feeling is that redundant stuff like type hints make programmers create more bugs because they don't see the forest for the trees anymore. I've been using
by gjulianm 4y ago
> My feeling is that redundant stuff like type hints make programmers create more bugs because they don't see the forest for the trees anymore.
I've been using type hints heavily and it's been such a great help in avoiding bugs and also faster completion in IDEs. Most of the time, with correctly typed functions you don't have to write explicit types for variables. It's a little bit more code, yes, but it's definitely worth it for any codebase that grows more than a handful of files. Even for smaller ones I have found it very useful.
- mrtranscendence 4y ago> I've been using type hints heavily and it's been such a great help in avoiding bugs and also faster completion in IDEs Agreed. I've been using type hints for the past few years now even though most of my projects are fairly small (< 10,000 LOC). I wouldn't say they've prevented a huge amount of bugs, but they've definitely prevented a few, and I think they've helped in library design and documentation.
- giantrobot 4y agoType hints are great at helping understand intent. A lot of bugs happen from understanding a code signature but not understanding intent. In a language like Python where types are all loosey goosey it's easy to write subtle bugs by misunderstanding intent.