Elixir for teaching programming

Hello, I will start soon to teach programming basics to a friend who’s is totally new to the subject. I’d really like to use Elixir as her first ever programming language. Would you make the same choice? Or do you think I’d better go with something more mainstream and object oriented like python, ruby, or even javascript (and staying away from all its quicks). I feel FP far more intuitive and natural (but that’s the way my brain works) so Elixir would be my obvious first choice. what do you think about it? Are there any drawbacks I’m not considering? Thank you for your valuable opinions.

7 Likes

I am also a beginner at programming with some basic experience in JS and was going to ask whether learning Elixir as a first language is a good idea. IMO FP is also more intuitive and from what I read might be easier to learn if you have no prior experience in OO.

3 Likes

Hello Alice, did you start studying Elixir already? If so, how your prior experience with Js has influenced your Elixir learning? Was it helpful or you find it somehow misleading due to the differences in data mutability and the usage of imperative constructs like i.e. for-loops? Thank you for your contribution!

1 Like

It maybe could be a good choice in some cases, I’m not really in a position to judge that. One thing I do think is important though is to think about the outcome. She would like to learn a programming language presumably for a reason, how does elixir specifically fit into that context. For example if she would like to make a mobile game then it probably isn’t a very good choice and she will likely have to learn an OOP language after to get there so the value in learning elixir is first fairly low with a high cost of time commitment. Similarly if she is thinking of a career change but there are no elixir jobs in the area she lives then it likely won’t further her goal that much in comparison to investing the time in something that has those career prospects.

6 Likes

The only thing I noticed was that the author of the online course kept saying that functional programming is not intuitive and I was like what are you talking about OO is not intuitive this is totally intuitive - input and output, what’s more intuitive than that. lol.

7 Likes

I remember a linked article on HN 1-2 years ago, written by several CS professors, that students who start off with functional programming can then very easily learn imperative / OOP programming but the reverse has been proven to be not true: if you start with imperative and OOP then it’s really hard to rewire your brain to work with FP. It does happen but it takes more time and effort.

So yep, Elixir as a first language would work better.

6 Likes

Thank you @mindriot, I agree with your considerations. She is totally new to programming, but feels interested in learning it’s rudiments to start with. There are no actual plans for the possible outcomes yet, first we’ll need to see if it is something she like to do for real. It is more a challenge I proposed to open some opportunity for her to get out of her comfortable zone of work’s field, as her present position is getting more and more tight and unpleasant for her. I believe that learning something new could boost her self esteem and lift her point of observation of the future. Also learning to program is something that actually has a concrete applications for a new job to come. Of course I am planning to expose her to HTML and some bits of Js, for their vast usage in current the market. But she needs to take her very first baby step, so for the time being we will forget about the direct outcome. (BTW, I’m a freelance dev, using Elixir/Phoenix for most of my customers projects, and I could easily see her helping me out with it, so there is also some kind personal interest in it :wink: but it is too early to even speak about that idea). Thank you for you valuable insight.

3 Likes

I am learning Elixir now, I’d like to help you with your work too if you need an assistant. Cheers.

2 Likes

In that case it would seem like the main goal here is to make it as enjoyable a start into the world of code as possible. For that I’d see Elixir as an excellent choice.

2 Likes

Thank you @dimitarvp I have the very same feeling about it. Learning to program with the functional paradigm teaches a sane mental discipline and you can then build on new paradigms applying solid reasoning processes that make cleaner and safer code! I will search for that article, thank you for pointing me to it.

Thank you Alice, your help is welcome! I’ll keep you posted! :slightly_smiling_face:

I recently hired someone for my team who actually learned to program with Elixir! It was his first language, and his brain is sort of “unstained” by object oriented programming. I’ll show him this thread and if he likes he can write some stuff up here.

2 Likes

This is not the article I originally remember but take a look at this one: https://computinged.wordpress.com/2015/07/31/why-should-non-cs-majors-learn-functional-programming/

2 Likes

Thank you very much @sergio, it would be very interesting to hear about his experience, the hard parts and the things that made the learning fun for him!

Thank you @dimitarvp, I’ll read it asap!

Just to add: I’ve been watching Computer Science lessons from Berkeley and from Harvard recently. Harvard starts with C (plain C language) and then transitions to Python. Berkeley is ~10 years old stuff, starts with Scheme language (Lisp-style, similar syntax adopted by modern-day Clojure) and the first two lessons are called “functional programming” actually.

Anyway, the stuff you learn in “computer science” is pretty much language agnostic… It seems to me it’s more important to have the syntax as clear and non-cryptic as possible so that you can focus on the concept at hand, rather than trying to understand the quirks of the code written in front of you.

Honestly, I think one of the safest bets and one of the nicest ways to learn is with Python and using Jupyter notebooks for that – it’s just beautiful, clear input, clear output, no IDE, no environment config, no compilation, no intimidating terminal, etc. And you should be able to go functional to large extent in Python too, if I’m not mistaken.

2 Likes

Jupiter notebooks is a nice suggestion! I forgot a about it actually… yes python is the mainstream options I was thinking about, even if I’m much more a rubist, and always had some hard times with missing ends and syntactic tabbing… Python is really trending lately on the market, and this is an evident advantage. Thank you @josefrichter!

1 Like

I’m starting to learn elixir too which resources are you using??

I’m still in the planning stage and deciding if it will be Elixir, and I received good feedback about it here. I haven’t thought of resources yet, because it will be a complete beginner intro to programming and I will do the teaching in person, side by side. Also I’ll have to do the lectures in spanish. I will prepare soon a program of the course to draw an educational path into programming, from the very very beginning. I have many books and most are languages manuals, so I will pick examples out of them, from Programming Elixir and also the Elixir guides, but I think I really have to adapt my teaching to her learning needs and gradually improve the technical level. I will try to organize all the material I will produce, maybe at the end of this experience it could be useful for others too. Thank you for the question, it is a subject that deserves some more thinking.

1 Like

I personally think elixir is a good choice for a first programming language. Functional programming is a lot closer to what people are used to doing in math class, which is where most people probably had their first experience with functions. I’d stick to teaching the basics of programming, flow control, loops, if/else, maybe pattern matching, etc. Stay away from processes and OTP, at least at the beginning. Have your student make more and more complicated single threaded programs, probably running as scripts or in iex, until you gradually begin to talk about processes and concurrency. That’d be my approach anyway.

6 Likes