DEV Community

Cover image for Pattern Matching in Elixir

Pattern Matching in Elixir

Kate Travers on April 27, 2018

At the Flatiron School, our mission is to help people learn how to code. That means that as a member of the engineering team, my work reminds me al...
Collapse
 
rhymes profile image
rhymes

Love this feature, thanks for the article!

Apparently someone is trying to get pattern matching into JavaScript as well: github.com/tc39/proposal-pattern-m... (they mention Elixir as one of the inspirations)

Collapse
 
ktravers profile image
Kate Travers

nice! i just saw this pop up in Ruby Weekly this week too: bugs.ruby-lang.org/issues/14709

pattern matching is so hot right now, who knew?

Collapse
 
rhymes profile image
rhymes

The advantages of declarative programming over imperative ;-)

Collapse
 
jpyamamoto profile image
Juan Pablo Yamamoto

Excellent introduction to Elixir. Gotta admit that pattern matching was the hardest thing to tackle before I could dive deep into the language, if only I had read a post like this. Elixir is an amazing language!

Collapse
 
dmerand profile image
Donald Merand

Excellent rundown. Thanks for this!

Collapse
 
nitzanav profile image
Nitzan Aviram • Edited

in ruby you can do: "#{user.first_name} #{user.last_name}".strip.presence || user.username.presence || "New User"

which is more nit than all

Collapse
 
cescquintero profile image
Francisco Quintero 🇨🇴

Now I understand a bit more! Thanks! :)

Collapse
 
devjoseweb profile image
Junior

Work market in Elixir in the world?