2 ms·
I would like to see optional static type checking. I don't even really care that much if the error is caught at runtime or not. I'd just like to be able to as
by lamontcg 12y ago
I would like to see optional static type checking. I don't even really care that much if the error is caught at runtime or not. I'd just like to be able to assert that certain functions always took or returned certain types, or that certain variables were always of a certain type.
I'm already winding up documenting these interfaces in YARD and testing this in spec tests. It'd be nice to just assert it in code as well.
I still like duck types to be able to write methods that take random objects and #to_s them or whatever without having to worry about declaring that they implement some Stringable interface -- but the more common case I'm running into is where parameters, variables and return types could really use strong typing to avoid errors.