3 ms·
As a long time Rubyist here's a brief rundown of the features Elixir has that made me reach for it with increasing frequency: * Pattern matching: http://elixir
by careersuicide 10y ago
As a long time Rubyist here's a brief rundown of the features Elixir has that made me reach for it with increasing frequency:
* Pattern matching: http://elixir-lang.org/getting-started/pattern-matching.html http://elixir-lang.org/getting-started/pattern-matching.html
* Guard clauses in function definitions: http://elixir-lang.org/getting-started/case-cond-and-if.html#expressions-in-guard-clauses http://elixir-lang.org/getting-started/case-cond-and-if.html...
* Macros: http://elixir-lang.org/getting-started/case-cond-and-if.html#expressions-in-guard-clauses http://elixir-lang.org/getting-started/case-cond-and-if.html...
* The |> operator: http://elixir-lang.org/getting-started/enumerables-and-streams.html#the-pipe-operator http://elixir-lang.org/getting-started/enumerables-and-strea...
For me those really are the killer features for Elixir. I know most people will point to Elixir's support for concurrency and the whole GenServer thing that it gets from Erlang when discussing why Elixir is interesting. And those aspects of the language/ecosystem really are awesome. But being able to nearly eliminate explicit conditionals with guard clauses is just so damn cool I can barely stand it. And the |> operator is something I desperately wish Ruby had. I like Elixir a lot because it seems to put a huge emphasis on making my job as a programmer suck less without sacrificing other things in the process.