Hacker News new | ask | show | jobs
by Swizec 1114 days ago
Thanks for putting into words something that was on the edge of my mind, but never quite graspable.

Two more examples (for me?) of features that I find you really miss in a language even if you’re fluent in the local idioms: First-class functions and pattern matching.

Passing functions as values is so nice and afaik most modern languages have that feature nowadays. But I remember when it used to blow people’s minds.

Pattern matching is something I’ve missed ever since having it in Haskell. Such an elegant solution to a problem that you have just often enough that the typical native approach feels clunky.

1 comments

Luckily pattern matching is also catching on.

Rust might be partially responsible for that, maybe? Python has also massively improved its pattern matching recently.

Dart 3 got very nice pattern matching [1]. And the next version of Java might introduce it (but likely it will still be behind a "preview" flag) as well.

[1] https://dart.dev/language/patterns