Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Right, 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.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: