AstonJ

AstonJ

How has Elixir blown (or expanded!) your mind? Please tell us here!

Can be something that’s unique to Elixir, or just something that it introduced to you. Can be something you discovered a while ago.. or something you just come across - whatever it is, please share :023:

Showing Posts 1 to 10

AstonJ

AstonJ OP

Well it was mind blowing enough when I first came across recursive functions, but I’m just reading Learn Functional Programming with Elixir (Pragprog) and I’ve just met a recursive function …inside a recursive function :icon_eek: :003: :lol:

Crowdhailer

Crowdhailer

Creator of Raxx

This might be a little bit tangential. Finding this in the OTP source really blew my mind. Make me realise even the most impressive software is made by normal people

https://github.com/erlang/otp/blob/52c11d5afd18405eaa293bb881eddf23f408850f/lib/stdlib/src/gen.erl#L240-L243

brightball

brightball

Completely changed the way I think about code…which is kind of a pain when I have to use other languages…

19
Post #3
voger

voger

Things that I had heard of but I was scared to try. Recursive functions. Enum.reduce and Enum.map functions. I have seen those in javascript but I was avoiding them over for loops.

kylethebaker

kylethebaker

This talk by Saša Juric is one of my go-to’s when trying to get people interested in Elixir. Being able to attach a REPL to a running production system and having all of these introspection capabilities at your disposal is something I don’t think any other runtime offers (or if they do it likely isn’t as deeply integrated with the runtime as you get with elixir/erlang).

15
Post #5
JoshHadik96

JoshHadik96

This is a simple one but my mind was blown when I first saw this line of code:

“def calculate(arr) when length(arr) <= 1 do”

I’ve never seen conditional declaration of functions before. Still haven’t gotten over how cool it is

idi527

idi527

def calculate(arr) when length(arr) <= 1, do: # ...

could be expressed as

def calculate([]), do: # ...
def calculate([elem]), do: # ...

which is a bit easier to understand (at least for me, since I can’t think of a function which would handle both an empty list and a list with a single element in it the same way), and probably slightly faster.

andre1sk

andre1sk

Not specifically Elixir but BEAM’s preemptive scheduler especially after working a lot with Node is truly mind blowing.

oldpond

oldpond

I am constantly blown away by how so much is achieved by so little code. Thank you, thank you, thank you!

JoshHadik96

JoshHadik96

Haha new to the forum so I’m not used to where everything is and I definitely thought your username was the opening to your comment for a second or two :joy:

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
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
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
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
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews