6 ms·
Here is a repost of a comment I made a while ago about why I love Elixir: The thing that constantly gets me about Elixir and Phoenix is the default tends to be
by andy_ppp 10y ago
Here is a repost of a comment I made a while ago about why I love Elixir:
The thing that constantly gets me about Elixir and Phoenix is the default tends to be the correct way of doing it. Let me explain.
For example, the other day, I was looking at filtering a next parameter to remove the domain (for security- you could redirect someone to fake login box on your host after they log in)... however it's unnecessary as redirect/2 in phoenix if passed a URL rather than a path will throw an error by default. As an aside different exceptions will return different HTTP error codes - for example a database not found exception from Ecto will cause a 404. There are hundreds or thousands of these little decisions that are the correct/simpler decision.
Elixir and Phoenix, for want of a better way of saying it, show great programming taste. So to say it's a coat of paint is a bit harsh; it's the right coat of paint, in my opinion.