4 ms·
Ok but if you can't constraint the types passed to a function then the universe of objects you have to test is massive. For instance you may have a performance
by bobbylarrybobby 4y ago
Ok but if you can't constraint the types passed to a function then the universe of objects you have to test is massive. For instance you may have a performance benchmark that checks that a certain operation runs in a certain big O -- say, you want to make sure a contains(collection, elem) functions runs in constant time. If you can't constrain the type of collection (to be some kind of Map, say) then you are left testing that all paths that call contain do so with a Map and not, say, a List. In a typed language the type system would ensure that for you.
- sdf4j 4y agoThat example is not very grounded on reality, isn't it?
- semiquaver 4y agoTry sorbet in a real project before you make this claim. It’s not perfect but it’s pretty good.