Hello, friends!
Context:
As you might know from this thread, I’m working on a presentation.
Following a tour of Erlang history, I have a slide which reads:
“If Erlang is so great, then why should I bother with Elixir?”
On the following slide, I mention that Erlang has a somewhat alien syntax, since it was influenced by Prolog and Smalltalk. New programmers can find that scary and off-putting.
I go on to mention that one of the reasons to choose Elixir is that the syntax is more modern, familiar and user-friendly than its big brother, Erlang. I mention that is feels kind of Ruby-esque. Of course, I also point out that Elixir only looks like Ruby on the surface and that it is fundamentally different.
Problem:
In order to make this comparison more immediate, I would like to show some semantically equivalent code-snippets from Erlang and Elixir, side-by-side. They need to be short enough to fit on one slide.
Some of the attendees have never seen Erlang or Elixir code before. I have not shown any code examples up until this point in the presentation, as it is very high-level.
I’m struggling to come up with some good examples that show off the differences between Erlang and Elixir. Preferably, it would highlight some unique features as well, e.g. pattern matching.
Question:
Could I ask for your help? If you wanted to illustrate the syntactical differences between Erlang and Elixir, what do you think would be some good (and terse) examples?
I will also refer to this forum thread in my presentation, so attendees can see more examples.