Is Elixir more understandable and easy to learn than Python?

Hello everyone!
I’m interested in your opinion, I read that Elixir is more understandable and easy to learn compared to Python, is it really true? I’m interested because I’m a beginner, is Elixir suitable for me or is it more for professionals?
I would be grateful for your thoughts!

1 Like

Hi @Ann, welcome :wave:

This question doesn’t have an answer, in my opinion :upside_down_face:. It’s subjective. I wouldn’t say that Elixir is “more understandable and easy to learn” than Python, no. I wouldn’t say it’s “for professionals” either, though. At the beginning of your programming journey, there are many great choices.

Elixir lends itself to a nice beginner experience in my opinion, and you will be able to avoid learning concepts that are taught in most intro to programming courses (mutable data structures, object-oriented programming) but that are not really necessary to get going.

On the other hand, Python takes the crown when it comes to being everywhere. It’s taught in most universities and colleges, it’s used in most fields, and it has a virtually-infinite amount of resources to learn from.

So, my two cents: don’t feel like you couldn’t learn Elixir, but at the same time, don’t think it will be significantly easier than learning Python is this is the first programming language you’re going to learn.

In any case, happy learning.

18 Likes

Do you know what you might want to use either of those for? I think it depends on that.

1 Like

if you can correctly tell me what the result of the last line is in python, then yes, python might be easier to understand:

def f(list = []):
  return list

def g(list):
  list.append('foo')

result = f()
g(result)
f()
16 Likes

On this note, if you are willing to focus on front end, elm provides a similar focused learning experience, where you don’t have to learn lots of irrelevant concepts.

2 Likes

It is easier and harder. The reason is, that Elixir lacks one ‘superpower’ of Python - mutability.

This makes it easier to understand what’s going on but also complicates some things (see ityonemo’s example, not possible in Elixir.) For most problems immutability is a good thing. Especially for producing maintainable code. (which is not a core concern of a beginner).

I have about 20 years of Python and 2 years of Elixir experience.
I’m more “familiar” with Elixir, though. I can better imagine how the implementation of a new problem will look in Elixir than Python. What the challenges and pitfalls will be.

When you start using concurrency, then Python becomes close to useless compared to Elixir. (Actors vs GIL threading). Also metaprogramming is way more powerful in Elixir. A big pro for Python is: there is a lib for everything. That’s what I’m using Python for now: a toolbox for quick scripts. Would never again start an application in Python.

3 Likes

I think it is [], right?

I think it is , right?

Try it :imp:

Sebb:
BEAM gives you some nice mutable things for pretty much most things you might need. ets, counters, atomics, process dict, if you really need it, but if you really want something mutable, these days there’s always a database.

3 Likes

Terrible, I have used Python for 5 years, but I still get confused in some strange places

I know how to fix this issue:

def f(list = None):
  if list is None:
    list = []
  return list
1 Like

I think you messed up your indentation!

3 Likes

Yes, my mistake

That’s pretty dirty.

Thank you very much for your advice and thoughts!

All languages are easy to understand once you learn them. In terms of easy to learn, no Elixir is more difficult to learn. Python, javascript and Java are the most used languages so have the most people teaching and learning them. Elixir is very cool but is definitely a niche language so lacks the incentive for people to teach it.
The path to becoming an Elixir dev seems to basically start at Senior level with Ruby as past experience.

No, that’s not true. Anyone can learn Elixir.

7 Likes

There is some truth in it though, as all the jobs that are advertised ask for senior or mid-senior level. If one was to learn Elixir as his first language, then as a junior dev it will be almost impossible to find a job.

1 Like

This is incredibly misguided. Sheer numbers don’t mean anything when it comes to learning languages. It can actually be a hindrance as search results get flooded with blogspam offering terrible advice. This forum is a source of very active, very talented people who offer great advice.

I think Elixir is a great first language though I do agree it’s hard to find work in. OP never mentioned anything about looking for work, though, so that may not be relevant.

6 Likes

Not to mention the SO space is VERY polluted by confused people going between 2 and 3. loads of stuff that ranks very high on google doesnt work or works wrong in subtle ways on python.

Also a lot more «black magic box» libraries, which is great if you are senior and know how to iterate fast and safe, not so great if you are trying to learn.

2 Likes

Both may be similar to pick up at the beginning. But I think there is one problem for future devs:
When you learn python, elixir will be easy to learn.
When you learn elixir, python will be hard to learn.
Elixir is simpler, has smaller standard library and mostly one way to most of the stuff.
In python the standard library is huge with sometimes duplicated functionalities and on top of that it has recommended packages for different tasks that do the same as standard library stuff. There are multiple ways to structure your code, multiple web frameworks, multiple testing libraries and so on. Some libraries are more oop focused, some more functional. This may be confusing but it will teach you different ways the code may work. Going from python to elixir you’ll feel that it’s well structurized and easy to pick up. Other way around will make you feel like starting learning from the beginning because you will jump to bigger stuff and not the basics anymore.