logoalt Hacker News

dajonkertoday at 9:57 AM2 repliesview on HN

In my honest opinion, if you can't live without static typing, Ruby just isn't for you.

Adding static typing to a dynamic language mostly gives you the disadvantages of both, without a lot of benefits. It's better to stick to languages that were designed with static types from the start.

I love programming in Ruby, having to worry about type annotations and the additional constraints that come with them would take a lot of the fun out of that.


Replies

networkedtoday at 12:01 PM

> Adding static typing to a dynamic language mostly gives you the disadvantages of both, without a lot of benefits.

Can you elaborate? I don't share this experience, and I'm interested in bringing static typing to a language without static typing, so I'd like to understand. In new Python and JavaScript codebases, optional typing has had clear benefits for refactoring and correctness and low costs for me. Legacy codebases can be different.

show 1 reply
vidarhtoday at 12:29 PM

I mostly agree with you, but I'd say adding typing to low level core APIs is helpful in adding optimization opportunities.