Elixir can be a lot easier to learn than Python

I stumbled on a surprising instance of Elixir being much easier to learn and use than Python: I was in each one’s REPL, comparing how to do some typical programming task. (I forget exactly, but it might have been JSON parsing.)

The function in each language was easy to call. And in Elixir, the REPL printed out the data structure result, and I could see exactly how it parsed the string.

Python, however, is object-oriented. And so it gave me a single result object. But the author of that class hadn’t written a __str__ method. And so the REPL couldn’t show me the data, but only the unhelpful default representation like <JSONResult #12682362>. In order to actually see the result, I’d need to consult the documentation/API and learn what methods I needed to use to extract the info. And then use them precisely as intended, and hope they work as documented. (Sometimes they don’t.)

But at that point, this was an epiphany. I stopped playing with Python and continued using Elixir. In Elixir, your data is simply right there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s