An open letter to Matz on Ruby type systems
I really enjoyed your keynote at RubyConf 2014. The most interesting part of it to me was where you talked about how Ruby 3.0 might include some sort of type system. There are lots of directions you can go with type systems in Ruby. Your presentation talked about how you like to explore different directions that you could go with a given feature.
I think there were two big points you made about a type system in Ruby that are important:
- DRY: adding types should not make the Rubyist add type declarations to their program over and over again
- Duck Typing: this is important to the way Rubyists program and any type system added to Ruby should still enable duck typing
After many years of writing Ruby, I have taken on a rather defensive programming style for a lot of the code I write after debugging too many type-related issues. I often find myself writing code like this:
Continue reading →