jslearner

jslearner

Will Learning Erlang help in Learning ELixir and Phoenix?

Will learning Erlang really help in being a better Phoenix or Elixir developer or is it a waste of time?

First 10 of 11 Posts Switch mode

Ankhers

Ankhers

Semantically Elixir and Erlang are very similar. So if you are thinking of learning Erlang in order to be “better” (whatever better would mean to you) at Elixir, it probably will not help all that much.

With that said, I would suggest at least understanding Erlang syntax. At some point in your Elixir career, you will most likely need to use an Erlang library for something. At which point, if you need to look into the code in order to debug something, it will very much help knowning Erlang.

peerreynders

peerreynders

Learning Erlang isn’t something you need to do from the very beginning. In fact in my personal opinion the best way to put it off is to learn Elixir via Elixir In Action 2e because in a very subtle way you are being prepared for the necessary aspects of the Erlang mindset.

I would also say that Erlang is easier to learn than Elixir provided you can get passed the ant turd tokens. Elixir adds value on top of that through hygienic macros.

Though my personal bias is that I have never been fond of Ruby’s syntax. In fact for people coming from Ruby it can be a bit of a familiarity trap.

A good free resource for learning Erlang is Learn You Some Erlang (it’s good even if you pay for it).

Also

is one of the best architectural books about the BEAM and OTP ecosystem

kokolegorille

kokolegorille

This page highlights syntax difference between Elixir and Erlang. It’s a nice start if You want to read code in both languages.

rvirding

rvirding

Creator of Erlang

The problems some people have with , , ; and . is truly amazing, and how worked up about it they can get. :roll_eyes: They spend more time writing blogs about how terrible they are than learning. It’s a strange world we live in. :joy: :wink:

hauleth

hauleth

Learning is never waste of time.

And for me, learning Erlang made me to be more aware of macros overuse. The less macros there are the better is UX of the library IMHO. Also some concepts of Erlang give nice understanding of how Elixir code works.

peerreynders

peerreynders

I personally have no problem with end of clause/expression/line tokens but the ongoing JavaScript semicolon debate is just a testament to how touchy many people can be when language syntax violates their personal sense of aesthetics or they feel it makes them type characters that in their judgement should be unnecessary.

rvirding

rvirding

Creator of Erlang

Lua has optional semi-colons between statements. They are not needed but can help catch some difficult to spot syntax “errors”. One is for example the creation and initialisation of multiple variables in one statement:

local a,b,c = foo(),bar(),baz()

However if I forget a comma I can get legal statements which give me strange results:

local a,b,c = foo(),bar() baz()
local a,b c = foo(),bar(),baz()

So I prefer being liberal and adding semi-colons often. A few extra characters are worth it. I would do the same in JS if I was to write it.

Sorry, wandering off topic here :smile:

yurko

yurko

If only there were no optional semis, there would have been no debate :smiley: The problem there is that semis are optional till they are not (for background “No semicolons” is the opposite of practical · Issue #78 · standard/standard · GitHub).

Erlang’s syntax is consistent, I don’t get the fuss about it not being that C-like either.

On topic: Learning Erlang definitely helps down the way - Erlang has tons of useful stuff that one can use in Elixir. That said - not something one needs from day 0.

OvermindDL1

OvermindDL1

I just think of them as operators, which they are.

, is a sequence operator (combine both sides to a single level sequence).
; is the expression operator (evaluate both sides and return the right).
. is the statement operator (evaluate both sides, no return, only makes sense in erlang between functions).

^.^

It actually quite bugs me when languages treat them as something that isn’t an operator, like lua or javascript or elixir does.

Like taking rust, ; is the same as in erlang, it’s the expression operator, evaluate left, then right, then return right. In Rust if you do something like blah ; blorp it returns whatever blorp returns, which also means returning it straight out of a function (last line doesn’t take a ; because it’s not a statement separator like in C++, it’s an expression operator).

Ankhers

Ankhers

Until just reading this, I have had an issue with excluding the ; from the last line of my rust functions (at least ones that return a value, it feels like I always add it). This makes so much more sense now that I don’t think of it as a statement seperator.

Thank you, sincerly.

Where Next?

Trending in Chat/Questions Top

krisleech
Hey folks, I’ve been using Elixir for over a couple of years (phx, ecto, broadway, oban). For this kind of work you do not tend, in my e...
New
mhindujadheerajsudan
Hi, I’m Dheeraj Sudan from the UK. I’m a software developer and also run a business with my wife Meenu Hinduja. I’m interested in getting...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement