4 ms·
Erlang/Elixir is best suited for large, long running, distributed system. Why? Because it has all the tools to handle such complexity, but you still need to un
by linkdd 4y ago
Erlang/Elixir is best suited for large, long running, distributed system.
Why? Because it has all the tools to handle such complexity, but you still need to understand it.
Someone who has never developed anything serious, or does not know programming, surely don't want to start with implementing such a system because they would not know what is the complexity, what is required, what are the footguns, etc...
By following the principle "use the right tool for the job", elixir is not the right tool to write "hello world".
My subjective answer to your question is: no it's not a good first programming language.
My bonus point: But down the line, you can only benefit from learning it.
- freedomben 4y ago> Why? Because it has all the tools to handle such complexity, but you still need to understand it. Eventually yes, if one wants to participate in open source or work professionally or write a very non-trivial application, but why would you need to understand OTP and actors and such when you're first learning? A hello world can literally just be a single line: IO.puts("Hello World") and you execute it with: `elixir hello_world.exs` When you get to parallelizable stuff, I think every language will have a learning curve. I do tend to think that OTP/erlang stuff would be harder, but thinking further on it I'm not sure why it would be harder than say threads or runnables in java or ruby, or asynchronous stuff (promises and callbacks) in javascript. Definitely interesting to think about. The Elixir stuff that I was thinking of that might be harder are things like immutability, pattern matching, anonymous (aka lambda) functions, etc. To some extent though even those can be avoided if you're writing simple personal scripts or solving Project Euler problems. Definitely worth some thought though, thanks
- linkdd 4y ago> A hello world can literally just be a single line Yes a bazooka can kill an ant. Does it make it suited for the job? > things like immutability, pattern matching, anonymous (aka lambda) functions, etc Immutability is easier to understand than all the problems that arise with mutability. Also with Elixir, unlike Erlang, you can rebind a variable, which does not break mutability and yet gives you some liberty with what you're doing. Pattern matching might be the most natural thing in the world: | I have this on the left, does it look like this on the right? vs | Bunch of if/else/switch/... that basically answer the same question Since I tasted pattern matching in Erlang/Elixir, I just feel limited whenever I go back to another language. But while those features might be nice and all, once you start searching about Elixir, the literature/forums/chats will be all about OTP, best practices, gen servers, distributed systems, and all of that. Because that's what 99% of the people using Elixir are doing. Just like starting with TypeScript, one might expect to see a lot of Javascript thrown in the mix. This will only confuse the newbie because they will not know what they're are reading.