3 ms·
If you come from the Ruby / Rails world, then you've probably developed some level of skin thickness about my biggest problem with elixir: it's dynamically type
by phtrivier 6y ago
If you come from the Ruby / Rails world, then you've probably developed some level of skin thickness about my biggest problem with elixir: it's dynamically typed, therefore almost impossible to write right the first x times. (For a value of `x` that's big enough for me.)
Coupled with the relative slowness of the compiler, this means your average development session is a loop of
1. trying to get something that pass syntax check
2. starting your application
3. making a request
4. `no match of right hand side...` because you had a function that expected `{:error {:ok {:foo %{bar: 0}}}` down a five-level-deep stack, and you typed `%{"bar" => 0}`, you fool ! Or maybe you typed "baar". Or maybe you did not type it, and some of your colleague did. How would she know ? `dialixir` was probably disabled a few years ago because the error messages were not helping anyone, and you're not going to write `@spec` anymore at this point.
I heard some people managed to overcome this by using the REPL, but in my experience it just means making the spelling mistakes in a terminal rather than in an editor.
Elixir is great for code that mostly does "routing" of messages from sources to sources.
Phoenix channels are a blasts.
Pattern matching would be great if the compiler could help you with the obvious mistakes.
Libraries are exactly how you would expect for a few-years-old language. Name one topic, and there are three competing libraries : one of them does not work, the other one is unmaintained, the third one has completely changed its API in latest alpha. You're going to pick the wrong one anyway.
If I could go back in time, I'd avoid writing any kind of business logic in it.
(Opinions mine.)