by krapsna · 9y ago · 0 comments
I'm not seeing why this is needed, other than people who find comfort in static typing think Ruby is broken without it.
I've been programming with Ruby every day for 5+ years, and it performs and debugs just fine without static typing.
My summary opinion is if static typing makes you happy go for it. Please don't try to force it into Ruby as a feature of the language, however, as it's current model of dynamic typing is one of it's best features.
This is a good thing for dynamic language adoption, because it means that organizations that evolve to where static typing is more important (larger teams and code bases, basically) don't have to either do a ground up rewrite or forgo it's benefits.
If you call a three-arg function with only two-args, it is more helpful to see a diagnostic than not to see a diagnostic, all else being equal.
1) use guards 2) add tests which check types 3) use error reporting software, like Sentry, and cath errors in production
Is there any reason you do not want not catch type errors without additional code and useless tests before you deployed it to production?
https://blog.acolyer.org/2017/09/19/to-type-or-not-to-type-q...