3 ms·
Actually, I think they are kind of duals to each other. With pattern matching it is easy to write new functions but hard to add a new case (you need to edit eve
by ufo 9y ago
Actually, I think they are kind of duals to each other. With pattern matching it is easy to write new functions but hard to add a new case (you need to edit every previous pattern match you wrote). On the other band with classes it is easy to add a new class but hard to add a new method (you need to edit every single class you previously wrote that implements that interface)
Functional programmers call this the "expression problem"