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

The sealed interface, final implementation case is an interesting one to inspect. Now you can, for example, write a parser with a fixed set of tokens and write switches that exhaustively handle every token. You now get compile time guarantees.


[flagged]


You really could do away with the arrogance.


I dont think saving a few lines for a very rare corner case is a strong reason to add a language feature


Maybe they have a point? Arrogance != Wrong in Your Opinion.


Sure, though as I mentioned in other comment, pattern matching is basically a better Visitor pattern. Which is while not the most common pattern, is not that much of a niche either.


It's just an example...

And you don't seem to understand that it's about the safety of the exhaustive check not just the sugar.




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

Search: