ouerghi01

ouerghi01

Hello Elixirists! :waving_hand:

I’ve been diving deeper into problem-solving using Elixir and its functional programming paradigm. From string manipulations to complex algorithms, Elixir provides a unique way of thinking about solutions.

I’d like to start a discussion where we can:

  1. Share interesting problems you’ve solved using Elixir.
  2. Discuss idiomatic patterns for common challenges (e.g., recursion, data transformation).
  3. Explore different ways to optimize solutions for performance and readability.

For example, I recently solved a problem involving:

  • Splitting a string into parts based on specific characters.
  • Performing transformations like mapping characters to values.
  • Reducing a list of values to find a maximum

Showing Posts 1 to 10

dimitarvp

dimitarvp

Just to put this on your radar: What Elixir related stuff are you doing? (800+ replies)

Additionally, maybe the algorithm tag would be of interest.

Also you might want to check out the Advent of Code threads, we have separate topics for each AoC day for several years now.

Finally, Exercism’s Elixir track was very interesting to me back then.

stevensonmt

stevensonmt

Just to piggy back the above, tehre’s also LeetCode which has support for Elixir solutions on many problems. It’s been fun to solve them in Elixir and other languages to see how the language influences the mindset.

ouerghi01

ouerghi01 OP

This is the link to my GitHub repository where I’m solving the 99 problems in Elixir:
Elixir-99-Functional-Mastery.

Everyone is welcome to contribute to this repository!

D4no0

D4no0

What is the goal of that repo? I’ve took a look at a few problems and they are solved by skewing the language onto the imperative solution that was initially designed.

ouerghi01

ouerghi01 OP

The repo is for learning purposes. I’m not really sure if my solutions work properly, but by tackling each problem, I will definitely learn something. Of course, if you see any implementation I did, it’s probably not the most optimized solution.

ouerghi01

ouerghi01 OP

I am learning the language by solving data structure problems and would love to engage with others who are on a similar journey. I’m also interested in building new projects or contributing to open-source initiatives.

dimitarvp

dimitarvp

Engagement provided: I eye-balled your List_processing.ex and… using length and Enum.at are basically anti-patterns. They have O(n) complexity and should be avoided at all costs – which is possible most of the time. You could do the Exercism list exercises and you have mentors there; they can steer you in the right direction.

And why does your file have a capital letter in its name when f.ex. macOS makes no difference between List_processing.ex and list_processing.ex (or at least that used to be the case before, nowadays I am no longer sure) but Linux does make that difference – you are setting yourself up for a hard-to-track disaster. Just don’t. Always use lower-cased file names.

So, maybe those two tidbits could be a start.

D4no0

D4no0

Thank you very much for the observation, that was exactly my comment, but oriented towards professionals in the domain (maybe in the not most constructive way).

dimitarvp

dimitarvp

It could be a constructive way to engage IMO, because many people latch onto appeals to authority and they want to emulate what they perceive to be a better / bigger talent than theirs. Sometimes they are even right.

…But I personally would find that argument unconvincing; to me the highest levels in any creative / engineering profession are characterized by the simple saying of:

Learn all the rules so you can break them.

That’s why I said that length and Enum.at are an anti-pattern… most of the time.

From my very limited interactions with language and/or high-profile library maintainers, they actually respect people who are not dazzled by their work and engage better with you when you attack their decision in an informed and critically thinking manner.

ouerghi01

ouerghi01 OP

I will follow your best practices, and thank you.

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 92995 915
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
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

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
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
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
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews