Newbee here - which book would be the best for someone breaking into Erlang?

Good morning. I have read a few posts concerning books. I have managed to get 3 books:

  1. Learn you some Erlang …
  2. Intoducing Erlang
  3. Programming Erlang.

A bit about this question. I am 55 and started with Elixir. I read the various books and did a bit of coding. Now, I am not looking for a “fixed job” as my age counts against me where I live.

As all of you have many years of experience, in your opinion, for someone who is only starting to learn to program, which book would be the best for someone breaking into Erlang.

To be honest, I did not really enjoy Elixir. It could have been a mind block. I have read on many forums that Erlang is more difficult to grasp (Syntax).

Apologies if this question is confusing. My entire life was outside of programming but I want to take the leap into Erlang for personal reasons.

Kind regards,
Dmitri

4 Likes

Hi,

If you go to erlang.org they have a learning section. Some things are free there.

Learning/community

4 Likes

Welcome Dimitri :023:

You already have some great books there so what I’d personally suggest is reading a little bit of all of them and then read whichever one resonates with you most or whoever’s writing style you prefer :003:

Often books cover many of the same topics but the author and their writing style can vary greatly - so definitely let your instincts guide you. The great thing is by reading multiple books at the same level also gives you a different perspective about the same thing or similar topics, and this can help you understand things better as you get multiple perspectives. That’s what I think anyway - give it a try and let us know how you get on :smiley:

4 Likes

Also you can join Erlang slack Erlang Ecosystem Foundation - Supporting the BEAM community it have a #learning channel with great people if you have questions.

4 Likes

Hi Dmitri,

I would definitely recommend “Learn You Some Erlang” as a first read, and front to back cover (or at least beyond the OTP chapters) to get started and comfortable (trust me, you’ll enjoy it :blush:), and only then pick up other reading material to foster and bolster up your knowledge. If you start reading other books in parallel too soon, you’ll get confused (that’s my experience at least). The other books dig deeper into details which you don’t need to get off the ground. You should know them if you want to become a good Erlang programmer, but the first step is to become just an Erlang programmer :wink:

Lies! Don’t believe anything you read on the Internet :grin:
That said, my reaction when I had my first look at Erlang code (a RabbitMQ example plugin) was something like “OMG geez! :flushed:

But seriously, it’s not really difficult, just very different (“somewhat scary and alien”, I read elsewhere in this very forum) from most other (frilly brace) languages. Then again, many things in Erlang are different, so it fits.
When you get past that first “culture shock”, you usually find that it is actually pretty nice. It just takes some time to appreciate the fact.

And IMO, it is a good thing that the syntax of Erlang is so different from other languages. My brain at least has less trouble switching out entire contexts than just some parts. For example, I once had to switch back and forth between Java and PHP (laugh all you want, it pays the bills :stuck_out_tongue_closed_eyes:), and I was always mixing up periods and arrows and $- and non-prefixed variables etc. I don’t have that problem when switching to or from Erlang, my brain just goes into Erlang or non-Erlang mode. I even found that, while recursion is just natural to me when in Erlang mode, I really struggle with it when using another language.

8 Likes

Oh, and you may want to try the Erlang track on Exercism after your first “baby steps”, to practice and improve your skills as you go along. They have small coding problems for you to solve (77 on the track, last time I looked), ranging from simple to difficult, and you can (should) upload your solutions and have them reviewed and discussed with you, all for free.

8 Likes

Thanks. I am slowly working through Intorduction to Erlang and am stumped by an exercise. Been looking for the fault all afternoon.

-module(drop2).
-export([fall/2]).

    fall(Planemo, Distance) when Distance >= 0 ->
	case Planemo of
	    earth -> math:sqrt(2 * 9.8 * Distance);
	    moon -> math:sqrt(2 * 1.6 * Distance);
	    mars -> math:sqrt(2 * 3.71 * Distance) 	% no closing period
	end
drop2.erl:2:2: function fall/2 undefined
%    2| -export([fall/2]).
%     |  ^

I have no idea what I am doing wrong.

3 Likes

Never mind. Found it. fullstop after end. Quite embarresing that after I post it, I find the error.

Coffee time

5 Likes

I’m still very new to Erlang and I might not have great advice, but I can tell you what has been working for me. I started with a Udemy course and Learn You Some Erlang. But I also read parts of Introducing Erlang, Programming Erlang, and Erlang Programming. Just recently, I also started reading Erlang and OTP in Action, which has been really great. I wish I had read the first few chapters of that first since it explains the reasoning about why Erlang exists and why it does things the way it does. It sets the stage really well.

I’ve been rotating through each of those books, sometimes re-reading sections. Each time I do that, I pick up something new, especially since I would often skip over things that didn’t make any sense to me at the time.

I’m now going through the Udemy course again and also working through exercises at Exercism.org. There is an Erlang track there and I highly recommend it.

I hope that helps a bit. I’m sure you’ll get much better advice from the long-time pros here, but I thought a fellow “newbs” advice might help, too.

4 Likes

Thanks. Could you provide the link for the Udemy course?

3 Likes

I actually have gone through two courses. The first one is Modern Erlang for Beginners by Roberto Ostinelli:

https://www.udemy.com/course/modern-erlang-for-beginners/

It’s excellent and I highly recommend doing that one first. The second one was Sequential Erlang by Daniel Hjerpe:

https://www.udemy.com/course/sequential-erlang/

It’s also good, but it moves fast and doesn’t have as much explanation as the first one, so I would recommend doing this one after you’ve done the first course. I believe Daniel is working on another follow-up course now, which I’m excited to check out.

6 Likes

Hi Dimitri!

The list of books what you provided is already good start! Nevertheless, reading books can be boring from time to time. So, here is few links what can be useful:

And of course current forum where you can ask about anything about Erlang and not only :upside_down_face:.

4 Likes

A post was split to a new topic: Erlang developers - are you remote or office based?

I started with “Programming Erlang”, for which we have a book club at DevTalk:

Still didn’t finish though, really should continue :slight_smile:
But I keep hearing good things about lyse, so i wanna read this too.

Also a nice challenge to practice is Advent of Code which will start soon again :+1:

6 Likes

If it is reading you want, you may also want to try the official Erlang IRC channel, #erlang on Libera. Don’t expect a huge party going on there, though, the channel is usually very quiet :cricket::cricket::cricket:. You can spend days there and the only thing that happens are joins and parts. With the advent of this new forum, it may become even quieter there…

That said, I sure wouldn’t want to miss the time I spent in #erlang and #ninenines (which is gone now, sadly)… Heck, I guess I should drop by there again one of these days and see what’s up :innocent:

3 Likes

Those were the days :blush:

2 Likes

Don’t worry, it takes time to get used to dots and commas.

Maybe human language comparison could help you remember about them. Some compare the syntax to written human language - where you divide sentence with commas and end it with a dot.

Forgetting a dot in shell is also something that takes time to memorize. Without a dot the Erlang shell is far less responsive :wink:

6 Likes

Advent of code is, IMO, a tad more challenging in Erlang - it seems to be geared more towards Python. December is by far my busiest month so I never get very far with it, no matter how good my intentions.

3 Likes

In my opinion, that might be true if you try to solve puzzles in the shortest possible time in order to get onto the leaderboard.

All of the puzzles can be solved with Erlang or any other BEAM language. I would say that some puzzles, for example those involving recursion, are easier to solve in a BEAM language. For some puzzles, the running time can be a little longer (minutes instead of seconds) if one tries solve it in a purely functional way, but that can usually be overcome by using ETS or the process dictionary.

@MononcQc has written a blog post about Advent Of Code 2017 where he shows how to solve all puzzles in Erlang.

On the Elixir Forum, there are a number of threads where people have posted their solutions for the puzzles from 2018 to 2020, most of them in Elixir, but also some in Erlang.

Yes, it can become quite stressful trying to solve all puzzles each day in December. To avoid the stress, one can solve puzzles from previous years at any time and as slowly as one wants.

4 Likes

I have a long way to go in my studies. I just looked at that AoC blog post and I stopped understanding those solutions on Day 2. :slight_smile:

3 Likes