Hacker News new | ask | show | jobs
by dmix 861 days ago
Pattern matching is fundamental to programming in elixir/Erlang the way go channels are in Go and super clean metaprogramming interfaces are in Ruby or types are in Haskell etc, you can do those things in other languages but when it's fundamental to the design of the language itself it filters down (or up) to every layer, where it significantly impacts how useful/powerful it is.

Elixirs pattern matching is the one thing I wish every language had from day one. Besides maybe an Optional/Maybe concept for error handling / data enclosures.

It makes for some very readable code and encourages passing return values that are easily consumed in a simple/functional way. Not capturing random error objects or unpredictable data structures.

Although I'm biased towards functional style, even though I code JS/Ruby for a living.