# How to overcome a mental block when learning Erlang?

**URL:** <https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627>\
**Category:** Resources Chat/Questions\
**Tags:** learning-erlang\
**Created:** [November 22, 2021, 8:31am UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627 "2021-11-22T08:31:32Z")\
**Posts on this page:** 12\
**Page:** 4

<div class="post-metadata">

**Author:** ![juhlig](https://erlangforums.com/user_avatar/erlangforums.com/juhlig/32/837_2.png) [@juhlig](https://erlangforums.com/u/juhlig)\
**Post date:** [December 17, 2021, 1:55pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/61 "2021-12-17T13:55:58Z")

</div>

> [@DmitriDumas](#):
>
> what book would be a great starter

As you might have guessed, it’s “Learn You Some Erlang”. It takes you by the hand and guides you through the foundations (syntax, types, etc) up to recursion (very important), through functional concepts and concurrency up to everything OTP and beyond.

What I really like about the book is the examples. Every (well, most) chapters are built around a small , self-contained toy project. This way, when you want to (re-)read any chapter, you don’t have to read the chapters before that to understand the example code; you need to know the _concepts_ that were covered in the earlier chapters, but not the _examples_.

As @Maria-12648430 mentioned, this book was written based on an older OTP version (R16 I think it was, maybe even older), and some things have changed in OTP since then. Maps, introduced in OTP 17, are covered only briefly in a postscript chapter, and `gen_fsm` has been deprecated and replaced by `gen_statem` in OTP 19.

At some point (_not_ at the very beginning, mind you), it may also be good to start browsing the Erlang docs instead of solely relying on the book. After all, when you’re finished with the book(s), this is pretty much what you will have to rely on, so better get familiar with it.

---

<div class="post-metadata">

**Author:** ![Maria-12648430](https://erlangforums.com/user_avatar/erlangforums.com/maria-12648430/32/604_2.png) [@Maria-12648430](https://erlangforums.com/u/Maria-12648430)\
**Post date:** [December 17, 2021, 2:03pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/62 "2021-12-17T14:03:04Z")

</div>

Yeah, what @juhlig said 😉

> [@DmitriDumas](#):
>
> I like watching videos and doing online tutorials

Personally, I can’t learn anything this way 😅  
For me, nothing beats books. Preferably _real_ books, printed on real paper 😊

So I fear I can’t give you any pointers in that regard.

---

<div class="post-metadata">

**Author:** ![DmitriDumas](https://erlangforums.com/user_avatar/erlangforums.com/dmitridumas/32/913_2.png) [@DmitriDumas](https://erlangforums.com/u/DmitriDumas)\
**Post date:** [December 17, 2021, 4:05pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/63 "2021-12-17T16:05:58Z")

</div>

The book “Learn You Some Erlang” as @juhlig mentioned isn’t the best for me at this point, but I am going to give it another go.

---

<div class="post-metadata">

**Author:** ![georgfaust](https://erlangforums.com/user_avatar/erlangforums.com/georgfaust/32/392_2.png) [@georgfaust](https://erlangforums.com/u/georgfaust)\
**Post date:** [December 17, 2021, 5:19pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/64 "2021-12-17T17:19:08Z")

</div>

> [@Maria-12648430](#):
>
> Concentrate on getting the easy stuff working, don’t cram tons of tiny details in your brain.

I second that.  
You do not need `apply/3`  
It’s just confusing now.  
There is so much you can so with the basic parts.

---

<div class="post-metadata">

**Author:** ![DmitriDumas](https://erlangforums.com/user_avatar/erlangforums.com/dmitridumas/32/913_2.png) [@DmitriDumas](https://erlangforums.com/u/DmitriDumas)\
**Post date:** [December 20, 2021, 7:18am UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/65 "2021-12-20T07:18:08Z")

</div>

Morning. Just a quick question. When you folks were studying Erlang, how did you come up with ideas of problems to solve in relation to your studies. Also, in your current work environment, do you form part of a team and do a part of the solution or do you do the entire thing.

Apologies if this question is vague, because I have the basics fairly well nailed down but cannot think of a problem to solve. It is all very well doing the excercises in the manuals, but coming up with something to solve is rather difficult as most of the problems are solved with other software (Excel, Word, messaging programs, etc etc.).

Thanks folks and have a wonderful day.

---

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [December 21, 2021, 8:56am UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/66 "2021-12-21T08:56:38Z")

</div>

It’s a very valid question, and one that I struggled with when first learning Erlang.

1. I reimplemented part of a codebase I’d currently been working on. Actually, that was a poor idea as it was running before I could walk, requiring learning how to use the mnesia database etc. But I did revisit it later.
2. Implementing a solution to one of our interview questions. This was actually a good move. I then re-implemented it using OTP.
3. Various small, standalone examples, as if I was trying to teach someone else. E.g., a state machine for a traffic light (not using OTP) and the simplest possible multi-user “chat” program.

> in your current work environment, do you form part of a team and do a part of the solution or do you do the entire thing.

This is doesn’t just apply to Erlang. In _very_ general terms, I’d come up with a concept and run that past others (in a formal or informal way, depending on context). I’d then have an iterative process of adding functionality, refining/reworking the design, fixing the inevitable issues and integrating with other components in the system. In short, if you are working in a team, you can use that to your advantage whether you implementing part of the solution or the entire thing.

---

<div class="post-metadata">

**Author:** ![DmitriDumas](https://erlangforums.com/user_avatar/erlangforums.com/dmitridumas/32/913_2.png) [@DmitriDumas](https://erlangforums.com/u/DmitriDumas)\
**Post date:** [December 23, 2021, 11:45am UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/67 "2021-12-23T11:45:51Z")

</div>

Good morning. Firstly, I ask that you please do not laugh at my progress as this is the VERY FIRST time that I did not look at any manuals. I did have to look up the ASCII, but in the spirit of the season:

-module(message).  
-export([greeting/0]).  
%% To everyone that I know here on the Erlang forum who has been extremely kind, patient and helpful …

```
greeting() ->
([77, 101, 114, 114, 121 ,32 ,67 ,104 ,114 ,105 ,116 ,109 ,097 ,115]).
```

---

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [December 23, 2021, 12:08pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/68 "2021-12-23T12:08:41Z")

</div>

Thankyou!

Just to prove that I tried it, I spotted the missing letter 😉  
In the spirit of fixing it via code:

```erlang
{L1, L2} = lists:split(10, greeting()),
L1 ++ [115 | L2].

```

PS I still had to look up the [lists](https://www.erlang.org/doc/man/lists.html) module (`lists:join/2` didn’t do what I immediately expected). It’s always good to keep the docs handy/bookmarked, especially for lists as they are so core to Erlang.

---

<div class="post-metadata">

**Author:** ![DmitriDumas](https://erlangforums.com/user_avatar/erlangforums.com/dmitridumas/32/913_2.png) [@DmitriDumas](https://erlangforums.com/u/DmitriDumas)\
**Post date:** [December 23, 2021, 12:42pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/69 "2021-12-23T12:42:08Z")

</div>

Thanks. could you explain the 10 to me. I am not at a console at the moment.

---

<div class="post-metadata">

**Author:** ![LeonardB](https://erlangforums.com/user_avatar/erlangforums.com/leonardb/32/1856_2.png) [@LeonardB](https://erlangforums.com/u/LeonardB)\
**Post date:** [December 23, 2021, 1:58pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/70 "2021-12-23T13:58:42Z")

</div>

```nohighlight
Eshell V11.1.8 (abort with ^G)
1> Greeting = [77, 101, 114, 114, 121 ,32 ,67 ,104 ,114 ,105 ,116 ,109 ,097 ,115].
"Merry Chritmas"
^^ missing an 's' which is 115
2> {L1, L2} = lists:split(10, Greeting).
{"Merry Chri","tmas"}
^^ Splitting the list at the point of the missing 's'
3> L1 ++ [115 | L2].
"Merry Christmas"
^^ adding the parts back together with the missing 's'

```

---

<div class="post-metadata">

**Author:** ![DmitriDumas](https://erlangforums.com/user_avatar/erlangforums.com/dmitridumas/32/913_2.png) [@DmitriDumas](https://erlangforums.com/u/DmitriDumas)\
**Post date:** [December 23, 2021, 5:19pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/71 "2021-12-23T17:19:50Z")

</div>

Appreciate it. Will add you code and explanation to my notes. Apologies for the missing ‘s’

---

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [December 23, 2021, 5:32pm UTC](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627/72 "2021-12-23T17:32:50Z")

</div>

No need for apologies!

[Previous page](https://erlangforums.com/t/how-to-overcome-a-mental-block-when-learning-erlang/627.md?page=3)
