Elixir VS C#

OK, I really haven’t read any replies from the page but I’m going to give you some pros about Elixir.

About the “OO” part

Ask your colleague if he ever heard of Dr. Alan Kay. Kay was the computer scientist who coined the term “Object Oriented Programming”. He invented the paradigm.

The truth is, Elixir is object oriented. In the classical sense. I won’t get into it, but you can check out the rationale here (seriously, go read that article!).
Actually, is C# who can’t get it’s own object orientation **** together. That’s not C# nor Microsofts fault though.

About the “C# can do what Elixir does” part

Well, that’s not actually true. Ask him about compile time macros. Ask him if, with C#, you can do this:

defmodule MimeTypes do
  HTTPotion.start
  HTTPotion.Response[body: body] = HTTPotion.get "http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types"

  Enum.each String.split(body, %r/\n/), fn (line) ->
    unless line == "" or line =~ %r/^#/ do
      [ mimetype | _exts ] = String.split(line)

      def is_valid?(unquote(mimetype)), do: true
    end
  end

  def is_valid?(_mimetype), do: false
end

The whole article can be found here.
Seriously. Take a good look at that code, because it breathes awesomeness. That code is compile time code that goes into the SVN of freakin’ Apache, takes out all the valid mime types FROM THE SOURCE, IN COMPILE TIME, and creates functions for all of them.

I’ve never seen C# code like that.

About the part that Elixir is awesome???

No need to say anything about that. It is. Period.

About the part that Erlang is awesome

Do you know of a project written in C# by a team of 30 people who can do 2 million concurrent connections in a single server, also backed by a large tech company? Well, I do know one in Erlang: Whatsapp.
Which is the base for Elixir. I don’t think I need to say anything more.

About the part of “more job opportunities”

As people from the software area, we all know the game changes too fast. There may not be jobs now, but I’m sure there were a group of people that dismissed Rails back in 2004 saying there would be no jobs for Ruby. And here we are, aren’t we?
I missed the Rails bandwagon, but I won’t miss the Phoenix bandwagon.

Distributed programming is easy with Elixir

C# though? Hell no. In my company we kinda use C# for everything, and I must say that distributed C# is painful. With Elixir, though? Hell, give me 3 machines so I can boost my app up!

Anyways, is great to have different opinions. Elixir isn’t great for everything, and the same can be said about C#. Right tool for the job, always. I hope I could shed some light on some of the many good points of Elixir.

8 Likes