jslearner

jslearner

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

Showing Posts 1 to 10

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? Top

Trending in Chat/Questions Top

huvaxstra
HI Its matin and new in Elixir (my pleasure) im creator of Land of Rust want to build something like land of rust but for Elixir. ne...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews