113
We did this to ourselves
(lemmy.world)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Op here back from the dead. This is in fact not a stab at dynamically typed languages, or at least not only: statically typed languages such as Java also support this kind of construct. In fact, one could develop a technically type safe programming language where an
instanceof
construct has sound semantics.What
instanceof
breaks is something called polymorphic parametricity, i.e. the fact that generic functions don't know anything specific about the types they are generic over. This is the fundamental condition for what in the community is dubbed "theorems for free", that is, naturality of generic functions between generic types.