Comparing Ruby with Elixir

Comparing Ruby with Elixir

Last week the first London Polyglot Tech event took place and was comparing Ruby and Elixir. This was a continuation of a similar event that took place in San Francisco last month.

The event was hosted at the CarWow Headquarters in Holborn.

Good news is that CarWow will be sponsoring the venue for the London Ruby Unconference! Holborn is a more lively location for Saturday! Thanks Akash for the support!

The event focused on exploring these technologies in more depth without attempting to decide which one is more appropriate.

Depending on the problem, there is a best tool for a job! So all technologies are welcome and can play with each other!

The technical contributors with some talks and a discussion panel were Evadne Wu, Maciej Matyjas, Louis Pilfol, Peter Saxton and Michael Wagg.

This post includes some of the questions and answers that came up during the event.

Question: what do you like the most from Ruby?

It is very easy to express the solutions in ruby, it flows naturally. You can write code that it is understandable and easy to read.

Question: what don't you like from Ruby?

Object Identities are not straight forward. Two objects with the same data should be equal but they are not if they are different instances!

Another thing is that there are many things happening underneath the surface of a program. Sometimes there is too much 'ruby magic'.

Question: What is your favourite thing about Elixir?

The small amount of time that it takes to learn some basics to be able to do a lot of things! This is true for people coming from the Ruby world.

There is one way of doing things right, this is a heritage from Erlang.

Question: What is one of the key differences between Ruby and Elixir?

The concurrency model is different. Elixir/Erlang follows a different approach to concurrency than threading and locking which is called 'The Actor Model'. The importance in this model is that all communications are performed asynchronously.

Ruben Vermeersch in his post about concurrency model in Erlang explains:

In the actor model, each object is an actor. This is an entity that has a mailbox and a behaviour. Messages can be exchanged between actors, which will be buffered in the mailbox. Upon receiving a message, the behaviour of the actor is executed, upon which the actor can: send a number of messages to other actors, create a number of actors and assume new behaviour for the next message to be received.

Question: How about functional programming is that difficult?

Function Programming (FP) is different than Object Oriented Programming (OOP).

FP is easier to learn since the functional programming concepts are less and can be applied in the same way to different problems.

In FP you are also interacting directly with the data structures without abstractions that could make more difficult to see what's going on.

Error handling might be less friendly in that you don't get the name of objects, this is more like debugging math functions.

Question: How is the Elixir community?

The Elixir community shares the same values of the Ruby community.

They offer great documentation and we are starting to see meetups and events that teach how to program in Elixir.

The Ruby community is great and it is very approachable. It is very common to have events where professional ruby developers help beginners to get into the language!

We are organising a great event with a session on the Elixir Language for the Ruby Community on Saturday, Oct 22nd!

If you don't have a ticket, please get one now


To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics