I was recently asked, "Is Elixir a good first language for someone to learn who has never done (serious) programming before?" After thinking for a minute, I realized that at some point in the last 20 - 25 years I really lost touch with this area.
My first language was C, and I did and still do think that was a fantastic first language because you can start very simply and don't have to learn a ton of programming concepts prior to writing some code. In my experience, learning to code is much more likely to succeed if you can write something (even hello world) and iterate on it. For example, working with people learning Java as their first language, they really struggle because you can't really do a hello world without encountering objects, classes, static keyword, public/private, and other things.
I love functional programming and Elixir, but I do worry that it has a few things like that to learn that might be a barrier to entry for a brand new programmer. Since I started procedurally and years later learned OOP, and then after that learned functional, I have so much baggage that I'm not sure I can weigh Elixir as a first language.
There's also the obvious, "what do you want to do with it?" question that matters. For example if you want to write frontend SPAs or mobile apps you have less flexibility. In this case however, that's largely irrelevant.
Is there anyone here who learned Elixir as their first (or first serious) language who can comment on this? Or is there anybody who started with a functional language and/or a lisp or similar who can comment?
(1) The most important thing to keep in mind while learning a first programming language is that it should teach you the abstract notions of programming, without entrenching your mind into a particular programming paradigm. (When I say paradigm, I mean procedural, functional, object-oriented, message passing---I'm sure I'm forgetting a lot.)
I have seen countless _very good_ software engineers struggle when switching but from one paradigm to another, but not between languages of similar paradigms.
In that respect, a multi-paradigm language is the ideal first programming language. Elixir's origins are functional, but it's evolved to be a multi-paradigm language [1].
(2) To have help along the way, you either need a strong/active community, OR a very helpful compiler. Elixir's compiler isn't particularly helpful, and the community is nascent, so in that regard Elixir isn't the best first programming language.
At the end of the day, I think someone's pre-existing mental model of computers should be the tie-breaker (for example, if it's someone with a strong mathematical background, I think they'd enjoy Elixir more than someone who'd get a kick out of making a cute website-based game.)
[1] I'm guessing the Elixir community would consider purely-functional Elixir as the most-aesthetically pleasing Elixir, keeping true to its Erlangian origins.