3 ms·
functional programming overall isn't that difficult. day to day elixir work doesn't require you to understand currying, abstract types or monads. If anything it
by cultofmetatron 4y ago
functional programming overall isn't that difficult. day to day elixir work doesn't require you to understand currying, abstract types or monads. If anything it really only makes you pickup immutable data, pass by value, immutable bindings (with implicit lets)
Functional programming gets really hard when you try doing stuff like state and IO monads. Elixir in contrast gives you genservers for state which is very simple by comparison as well as having dead simple IO. you don't have to make special functions marked as IO or use any type of exotic type theory.
TLDR: yes Elixir is functional but its the 80% that is easy to learn. you don't have to bother with that last 20% of functional programming rabbit hole crazy town.
source: me with 6 years of elixir experience and having built the entire backend for my startup in elixir over the last 3 years. Elixir is s a platform that fits a nice sweet spot where you need to knock something out fast and still have something reasonably maintainable (and refactorable) that also happens to be really fast(performance wise) for the level of day to day developer productivity you get.
- redanddead 4y agowhat would you say that elixir does better than anyone else?
- cultofmetatron 4y agobetter is subjective so I'd rather not go into that too deeply haha. Its all about the tradeoffs you're going after. If you absolutely need to cut down errors to a minimum and are willing to sacrifice developer speed/productivity, Haskell with IHP is certainly a compelling offer. (yes I know an experienced haskell dev will probably be jsut as productive as a experienced elixir dev but it will take much longer to train someone from another language to haskell than to elixir.) conversely, if you want speed at all costs, rust is certainly nice. now if we're talking Pareto efficient intersection of performance, developer productivity and maintainability, yea elixir hits that sweet spot well. I haven't encountered a language that does that better yet. Python comes close if you're willing to take a drastic hit on performance. The tooling is descent, the day to day ergonomics let me focus on solving our startup's problems rather than wrestling with the platform. It's not perfect (lord knows I wish there were more libraries).