3 ms·
A pattern matching solution is much more readable and it forces you to build small functions if you are pattern matching in the function declaration.
by agbell 17y ago
A pattern matching solution is much more readable and it forces you to build small functions if you are pattern matching in the function declaration.
- silentbicycle 17y agoRight, AND being able to match on multiple fields and destructure them means that several awkward "which class owns the method" problems never arise in the first place. (Multimethods are similar in many ways, though I find pattern matching far more useful.)