ouerghi01

ouerghi01

Problem-Solving in Elixir: Share Your Tips and Challenges

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

Most Liked

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.

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.

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.

Last Post!

bennydreamtech23

bennydreamtech23

Would check it out Thanks

Where Next?

Popular in Discussions Top

CharlesO
Erlang :list.nth simple, but 1 - based nth(1, [H|_]) -> H; nth(N, [_|T]) when N > 1 -> nth(N - 1, T). Elixir Enum.at … coo...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 20142 166
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19814 150
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement