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

Sometimes it isn't desirable to scatter the logic across many classes, or conflate the data and the handling. The Java world has the "visitor pattern" to help deal with that, but its double-dispatch is clunky, complex and verbose. Pattern matching just generalises switch and makes it more useful. Java is genuinely a better language with this change.


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

Search: