In 2019, I was looking for a project.
I'd already been successful in founding WikiJob, but that was a decade ago, and I've had little to show for it since then.
I wanted to get back into programming, and had always been curious about Erlang and BEAM. It seemed like it had mythical properties - a vast difference from where I had been residing in Python-land.
Elixir, to the un-initiated, is a macro language of Erlang, and looks a lot like Ruby or Python, from which it takes its lead.
Cosmetically though, that's where the similarities end.
Elixir is a functional language. There are no 'for' loops, 'if' statements are frowned upon, favouring ideas I was less familiar with (pattern matching, map-reduce) as the go-to methods for all things.
But you can read about that elsewhere.
WikiJob sells traffic to other websites. We'd been stuck using Clickmeter and GeniusLink for a while, and while they have their merits, they weren't really what we were looking for.
Deciding to scratch my own itch, I decided to build us a replacement, choosing Elixir's Phoenix as the framework.
So, I began working on what would become the click tracking software
Linkly is click tracking software for marketers. It works like a custom URL shortener, and allows marketers to redirect users based on location, or device, rotate them randomly, or add tracking pixels (and a bunch of other stuff).
Learning Elixir was a fun process. I'm scientifically minded by nature, so it's pure-function approach made a lot of sense.
The layout of Phoenix is very similar to that of Rails, so those migrating will have little trouble getting to speed.
You may have read elsewhere that one issue is the lack of decent modules.
I think this is a double-edged sword.
Most services online can be accessed by normal HTTP protocols, and Elixir handles this really well (especially the tesla library).
In my (albeit limited) experience, I found that using Rails Gems became a mess.
They were often very large, covering an entire API when you only needed a couple of functions, and were highly reliant on the maintainers keeping it ship-shape.
Not having this has actually helped me develop my skills by writing direct integrations with APIs, for just the bits I need.
I don't think I'd go back now.
I feel like test-driven development was cool a decade ago; people rarely mention it now.
Elixir has a testing framework (ExUnit), which allows you to write unit tests for your code.
This makes sense for things where Elixir is doing 'logic', but building functional tests (Capybara/cucumber style testing), is something where its a bit trickier.
This is not as much of a problem as it seems.
It's often said that Elixir programs are easier reason about than OO/MVC apps, and this is true- although it's something you'll have to see once you really get the hang of it.
As you're encouraged to write short, pure functions, you can write the test as you're writing the function (I normally have them side-by-side, favouring running tests instead of testing it out in the browser).
Linkly is hosted on Gigalixir. Gigalixir is one of very few choices for Elixir-first hosting.
The experience of using Gigalixir will be familiar to those who have used Heroku; it's a similar platform-as-a-service.
So far (7 months?), the experience has been pretty flawless.
Integrating Stripe was not that painless.
This is probably one place where having a nice gem would have been good (but then, where's the learning in that? :) )
There's a funny thing about Rails that no-one ever mentions.
It's literally called 'rails' - that is, it keeps you on the rails.
Elixir's real strength shines when you go beyond Phoenix and build fully realtime, memory driven, not-database bound applications (for example, a betting exchange).
Normally, all the logic is written entirely in Elixir, and help in memory, and Phoenix or a database is an option but not a requirement.
Elixir can do this (where Ruby can't), because it's running on a stateful VM.
Requests for most modern frameworks are stateless - once a webserver has sent the page, it forgets about the user until they submit another request.
It's Elixir's ability to keep everything in memory (in a lightweight fashion) that allows it to concurrently serve thousands of users in a realtime setup.
Elixir is a fabulous language - it's a real indication of where things are going, with functional/ML style languages become more popular (as they are uniquely suited to the web's request-oriented structure).
I suspect programmers have a tendency to love the tools them invest all their time in (vim, anyone?). Heck there's probably someone out there who can make a case for Java.
I think in short though, I made the write choice.
It wasn't so much that the end result would have been better or quicker had I used Rails; it's that 7 months on, I find myself a much better programmer than I was starting out.
So, here's to 10 more years of Elixir, until something even cooler comes out...
Chris Muktar is an 'for-fun' programmer and mini-entrepreneur.
Linkly is click tracking software for marketers. Try it free at https://linklyhq.com.
Oh and by the way, the sales page is made with Squarespace, because seriously, who likes doing CSS?