Hacker News new | ask | show | jobs
by tablarasa 1059 days ago
> "Since the IDE can hardly infer any type, and since even the ones it could infer can dynamically change in shape at any time, the IDE cannot provide as helpful suggestions and as powerful navigation as IDEs for other languages can."

I've felt this pain a lot. I finally took the time to learn how to make use of the type hinting that python does offer, and now I write those type hints without even thinking about it. It makes the development experience so much better for me and across the team, since we've all bought in. It doesn't do everything. It is kind of lipstick on a pig. But it's worth doing.

2 comments

About using type annotations in Python: Do you get any push back from your team? I do. "Oh, it clutters the code." I don't know how to reply. And, they continue to write complex code without type annotations. It is hard to reason about. It is a never ending battle with people who come from weaker typed language. They struggle to see the value of stricter types.
Sure, a little bit. It is a change in peoples' workflows after all, and a lot of developers are pretty choosy about that. But I think you can overcome that if you make a respectful case.

I think you are spot on that people coming from weakly typed languages often don't realize what they're missing. "It clutters the code" is really just "I'm not used to seeing it that way" so if you can get people to try it out (maybe in a well-cordoned area of the code base or in some new dev) they will find out for themselves that it saves time and grief in the end.

Thanks for your reply. Unfortunately, your strategy has not worked for me. The mostly Python people are me continue view types as a burden, not a benefit.
I feel a similar way about typescript. It outsource the mental complexity into compile stage instead of directly on runtime.
100% yeah totally agree, I feel very similarly about TS (and can barely stand vanilla JS at this point)