@owensd It's rare, contextual, & never done outside of a protocol for me.
[1]
-
-
-
@allonsykraken I don't find it rare at all. I often deal with collections of types and that requires type erasure a lot. -
@allonsykraken so I really just end up coding against the protocol itself and the specific type is not really even needed to be known. -
@owensd Right! I haven't needed to deal with a "collection of types" scenario yet but personally I find type erasure very useful sometimes. -
@owensd Maybe I'm missing something here too. Sometimes I see convos indicating bad things about type erasure. I'm for it TBH -
@allonsykraken I find it easier to forgo the additional type information early on so I don't have to deal with the boilerplate later. -
@owensd True story. It's why I do it. I don't think it indicates anything when you have to keep using it. I could be wrong, but I believe... -
@owensd other languages do it for you by the compiler generating thunks in common scenarios. It stinks that we have to do it by hand
-
-
-
@owensd it suggests that we badly need generalized existentials -
@anandabits and once you have that, all you know again is that you have a Power from calling attack(). - View other replies
-
@owensd the amount of type info will depend on the constraints you provide. Right solution depends on your problem and your design of course -
@anandabits@owensd Being only as precise as you need to be lets you stay flexible and avoid unnecessary refactoring. -
-
@anandabits@owensd Absent other constraints, I think it's better to err on the side of more general types. -
-
-
@owensd Only keep the types you need. Type hoarding is unhealthy and may require professional help -
@owensd Of course, it could just be a failed attempt at being clever in my case
-
@owensd Sometimes code doesn't care about the underlying type. Just the behavior guaranteed by that protocols contract. [2]
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
David Owens II
HecthorOS
Matthew Johnson
Joe Groff