4 ms·
Most people can be brought to realise that they are going somewhere dark when they're using typeof in an if statement. This is a whole language construct built
by jmartinpetersen 10y ago
Most people can be brought to realise that they are going somewhere dark when they're using typeof in an if statement. This is a whole language construct built and communicated around this (dark) idea.
I understand that general pattern matching is A Really Nice Thing and that Mads misses it from SML (or something like it), I just can't see the value for all the dangers from an OO perspective.
- KirinDave 10y ago> Most people can be brought to realise that they are going somewhere dark when they're using typeof in an if statement. This is a whole language construct built and communicated around this (dark) idea. I'm really confused by your statement on multiple levels. For one, Scala has been doing this for some time and it's one of the less controversial and mostly well-loved things it does. For two, Clojure's been doing it on the JVM and that's hardly Clojure's problem. F#'s been doing it in the .NET interface layer as well. Maybe get specific with your problem rather than saying that there are invisible dragons that only your legendary intelligence can perceive. Because pattern matching and deconstructive binding saves a lot of code and often has a powerful "say what I mean" factor for developers. Comparing it to a typeof conditional chain (which is considerably more awkward to maintain because of the general awkwardness of conditional cascades) seems to me like a very weak argument.