Hacker News new | past | comments | ask | show | jobs | submit login

> (I won't bother explaining the retrospective idiocy of that.)

Good, because people have done actual surveys to show there's no real decrease in bugs, and development time suffers: https://arxiv.org/abs/2203.11115

It's a trade off like anything else, Python has a lot of scientists who probably love not having to specify types everywhere. Python's best advantage is ease of development - Rust is in _no way_ an alternative in that department. Go would be a better choice.

It's biggest issue imo is it's slow, but since people aren't rushing to use mypy and friends, perhaps that's not important for most users. And it's had types for ages if you want them.




Even the article you linked flat-out says static typing is better:

> The analysis indicates that TS apps exhibit significantly better code quality and understandability than JS apps [...] Furthermore, reducing the usage of the `any` type in TS apps was significantly correlated with all metrics except bug proneness.

> It's biggest issue imo is it's slow, but since people aren't rushing to use mypy and friends, perhaps that's not important for most users.

People are rushing to mypy. Every Python library now has type stubs available. That wasn't the case even 3-4 years ago. Similar story with the mass move to TypeScript, which currently is the fastest-growing language[0].

Dynamic typing[1] is a legacy of ignorance and immaturity in the industry, from the same era where it was common to put your php $_GET parameters directly into a SQL query or access your C array without bounds checking. For the most part, the industry is smarter than this now, thankfully.

[0] https://visualstudiomagazine.com/articles/2023/02/02/jetbrai...

[1] note I'm really getting at "dynamic by default" -- there's certainly a use case for objects whose structures are only known at runtime, but that should be the exception, not the rule.


The article says code quality is better but development time and bug fixing time is worse. You chose to simplify that to 'better', I chose to see it as a tradeoff.

People are rushing to mypy for type checking, not speed improvements. I use cypthon and VS Code still does type checking for me; I don't care what program is doing it.

My argument is that truly static typing is too extreme in the other direction. Many times you don't care about type checking - quick scripts, data science, handling large JSON blobs - and informing the compiler is just boilerplate work. So I think we agree there that a static language with an 'any' type, like TypeScript, is the happy medium here.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: