How I got myself into alchemy - part I

I am a notorious cheater.

  • in 2001 I've betrayed Java for .NET
  • until late 2006-2007 I've been involved in several, stormy romances with unmanaged C++ (we had some past already ...)
  • around 2011 I began secret meetings with JavaScript, a lot of passion & screaming was involved
  • in 2013 I went full-slut-mode by pretty much ceasing relationship with .NET (we'll still friends, with benefits ...) & being seen in the company of many different programming languages (mainly Scala & Go)
  • in April 2014 I've met Erlang, it was the love at the first sight, but we were clearly not meant to be together, but ...
  • ... in the beginning of 2015 Erlang has introduced me to her younger sister - Elixir. We're together since then.

People keep asking me: what's the point in moving from a well-acknowledged, resource-rich, popular & market-demanded platform like .NET to such a niche, that almost no-one has heard about?

And that's what this blog post is about.

Why did I decide to go out of the comfort zone?

First, I don't aim to be the coolest kid on the block by knowing the biggest number of languages or frameworks. Actually, being able to declare a variable in 20 different dialects does not make us better craftsmen by itself. If you know well (let me emphasize that again - well) one language / platform of reasonable versatility (like Java or C#/.NET), you can pretty much cover majority of so-called market. What really matters in that case is how good you actually are in using this one, particular language / platform; the choice is usually far less crucial than you may think.

But let me quote Nathan Marz - creator of Apache Storm:

Different languages / platforms represent different paradigms, introduce different patterns / ideas for solving similar problems with different tools & approaches. The point is not to round-robin through all of them (new day = new framework ...), but to learn the differences, cognitively expand your thinking horizon, broaden your palette of techniques & make your own opinions on various problems & their most viable solutions.

Sometimes, you just have an urge to cover more ground. In my case I wanted to try lightweight client apps, so I've decided to try JavaScript-based SPAs. Similar thing has happened when I have been tempted by ultra-rich JVM-friendly Hadoop ecosystem that doesn't really get along with Microsoft stack - I needed a language that compiles to JVM bytecode and at the same time it is not Java ;)

Why Elixir and not something else?

Due to three reasons:

  1. It offers what I wanted from Scala, but it has failed to deliver
  2. It offers what I wanted from Erlang, but I've found it "not digestible enough"
  3. Elixir community is freakin' awesome

Let me elaborate a bit more on that:

My first impression about Scala was quite typical:

This is a modern language I've always wanted - mixes all the best features of other languages in a concise, coherent boundaries!

Wow, Functional Programming can be really cool, without giving up object-oriented foundation!

I can use all the JVM-based goodies without dirtying my hands with Java, neat!

OMG, actor model & Akka are awesome!

All these syntactic sugar pearls ... so yummie & fun-packed ...

What has happened next was typical (for Scala) as well.

  • syntactic sugar has appeared to be massively overdosed
  • syntax is optimized for writing, not for reading code which is a major, inexcusable flaw
  • SBT is rather a Slow Build Tool, than a Simple Build Tool
  • yes, I can use any JVM binaries, but it's not really Scala anymore then (tbh, it's still not nearly as bad as in F# VS C# code case)
  • functional-OO hybrid doesn't feel that good as it was meant to be

Don't get me wrong, I still love Scala, but it seems broken in a way that's really, really hard to fix ;/

What about Erlang? It's not hard to figure that out: proven language fit for a purpose, incredible capabilities as a testimony of nearly-prophetic intentions of its creators, but ... it feels extremely dated in terms of tooling, conventions, syntactic concepts, etc. In other words - if you're about to create telephony application for some TelCo, go for it. But if your aim is something as extraordinary as a web app, well ...

Mixing Erlang with Ruby sounded like the dumbest idea ever, but ... surprisingly it has worked. Elixir has all the advantages of Elixir (& many pros of Scala), but it is devoid of almost all their flaws.

Still, it wont' solve your problems "auto-magically". These two quotes by Andrzej Śliwa describe it perfectly:

The next post in the series can be found here.

In the following post(s) I'll try to answer the following questions:

  • Is Elixir for everyone?
  • Should we expect it becoming the Next Big Thing?
  • Why I want to be like Mr.T?
  • Commercially speaking - does it make sense to switch to Elixir?
  • Does a life without Visual Studio & ReSharper make any sense at all?

Pic: © aga7ta - Fotolia.com