Pattern Maching in Programming Languages Several functional
programming languages (e.g. Scala, Haskell, and ML) support
pattern matching of data objects. Recently Martin Odersky, the
designer of Scala, explained pattern matching. In a recent
interview with Bill Venners at Artima.com Martin Odersky
explained how pattern matching works in Scala, and what its role
is. It is impossible to argue that pattern matching isn't useful
to programmers. Especially to those writing compilers. But I
don't agree as Martin says, that it is essential. I think he
realizes this, and it was just a mild exageration. In the world
of compiler writing, after you have gotten used to pattern
matching, it is very painful to go back. I do however have one
issue with pattern matching: the deconstruction of objects is
coupled with the construction of the object. I don't believe
that the consumer of data (e.g. objects) should care about how
that data is produced or structured. Otherwise, we can't make
changes to the production of the object