Could improving in Elixir help me with other functional programming languages?

Hi everyone. The company that I’m working on decided to change the programming language for all new services to Scala. I don’t know much about Scala, but I do know a little about Elixir. The question is, the Scala being used is the pure FP one following Cats and Cats Effect which I found extremely hard to understand. What I’m thinking is, could my Elixir study, outside of work, help grasp these concepts in Scala?
Unfortunate changing jobs is not a option right now, also the market is not the best.

1 Like

Anecdotally, I could never understand Haskell when i did more python programming back in the day, but after doing elixir for these last few months I’ve been able to do a lot more with Haskell. Not a sure fire thing , just an anecdote, but for me it helped.

3 Likes

This is the hypothesis that I’m trying to validate. I remember doing Python at college and it made me understand Java better because it was OO without the boilerplate. I would say that Elixir and FP Scala is “the same” in terms of FP principals. Of course the languages will focus on different things given that one is dynamic, and the other is typed. But if I get the FP part out of the way, then I just need to focus on Scala types, which are really hard.

I have found Elixir to strike a perfect balance between the objectively field-of-work-improving aspects of FP and pragmatism. I do appreciate what Haskell is trying to do – religiously isolating everything that has side effects and loudly screaming if it starts propagating is one of the examples – but when you stumble upon 4-8 String types and the library you need only works with 2 of them, you understand they have lost perspective.

I mean, I can’t blame a heterogeneous community of course. They are not all a hive mind. But Haskell’s community seemed hellbent on just doing its own thing and not caring too much about actual working programs out there.

I have also met a few commercial Haskell programmers and they struck me as a very high profile and super intelligent people. So again, nothing against the language or the ecosystem.


To answer your question: yes, IMO Elixir absolutely helps you learn FP and gives you a lot of transferable knowledge.

I feel like elixir does well in teaching functional programming because it makes many things optional, which are required to be used and unterstood elsewhere. That list includes (static) typesystems, monadic composition and related programming patterns, explicitly dividing the pure from the impure and likely more.

It also does well because the processes give you “back” statefulness (where needed) in a very powerful way.

The problem with scala is that it has all of the features of imperative and OOP languages, namely classes, mutability etc. If you have a skilled team that worked with FP ecosystems before, then there are a lot of things to be gained by shifting to a more FP style, otherwise this is just java with multiple steps.

The same is true about elixir, the only big difference is that the ecosystem doesn’t offer much tooling to write code in a imperative way, so naturally you end up writing more functional code.

1 Like