3 ms·
It's not argument "against" selecting it (it's a free world, and mileage vary), but a couple of scar-earned advice: - Be careful about libraries. If you know t
by phtrivier 5y ago
It's not argument "against" selecting it (it's a free world, and mileage vary), but a couple of scar-earned advice:
- Be careful about libraries. If you know that your system has to interact with X, don't assume that there is a running, idiomatic, maintained libary for X on `hex.pm`.
Do a bit of due diligence.
We had experience ranging from `meeh` (oauth2, graphql, http) to `pretty bad` (mqtt, swagger.)
But as other say, if you're doing vanilla Phoenix/Plug/Ecto with exactly the right kind of DB, you'll should be ok.
- Give a little though about how you'll be deploying and operating. `releases` and `configuration` haved changed in pretty big ways in the past (https://elixir-lang.org/blog/2019/06/24/elixir-v1-9-0-released/ https://elixir-lang.org/blog/2019/06/24/elixir-v1-9-0-releas...), the ecosystem is constantly in flux (`config.exs` vs `Application.get_env` vs ENV_VAR vs..) . Plus, the erlang virtual machine (BEAM) has knobs that are not always easy to play with. And if you hide it behind, say, docker containers, you'll have other troubles. Don't expect an `heroku do-some-magic` experience.
- Unless you're familiar with the Actor Model already, and your application is very simple, expect a learning curve made of:
1. A period where you're afraid of GenServer and fail to do anything because you don't want to create a supervision tree
2. A period where you think you've understood GenServers and you create GenServers like crazy
3. A sobering period where you don't understand anything about your application
4. A couple of refactorings where you move the pendulum until you reach something that's acceptable
- Finally, you're coming from RoR, so you're probably fine with not having static types anyway ; may St Isidore help you ;) There is a thing called `dialyxir`. It might help a bit ; It will disappoint a lot.
- canadianfella 5y agoWhat is ‘meeh’?
- toolz 5y agoInteresting, some of the libraries you mention such as graphql and http, I feel there aren't better libs that exist than absinthe and ranch/cowboy. Which graphql library do you prefer over absinthe in other ecosystems?
- phtrivier 5y agoFrom what we understood (back when we shopped for a lib, which was a long time ago), absinthe advertised itself a lib to write graphql servers ; we were looking for a graphql client,so we ended up using a smaller lib. (And it's entirely possible that we simply picked the wrong lib ! Which is, still, kinda my point. Every elixir lib is "young" by virtue of the language being "young", so you can't use "age" as a heuristic for being the "right" lib. Happens for all"young" ecosystem,so not particular to ex.)
- christhekeele 5y ago> absinthe advertised itself a lib to write graphql servers ; we were looking for a graphql client > And it's entirely possible that we simply picked the wrong lib ! This is 100% a failure of a decision-making process, not the language ecosystem. Picking the wrong library could be avoided by the smallest amount of diligence, it's pretty language agnostic.
- pmarino90 5y agoNice points indeed! I would also say that the "library" one is basically valid for every language. In general is always a good thing to spend some time analyzing the possibilities before importing an external lib into your application.
- jswny 5y agoWhat you said about releases is somewhat true, but I’d like to clarify. It has absolutely changed a decent amount over the last few years. Because it used to suck. It’s not really in flux, more like being improved because everyone knew it sucked. It’s in a much better state now and I’m very happy with it where I wasn’t before. Also, I would say that “in flux” isn’t a proper characterization because it was always backwards compatible. Nothing broke, they just improved the experience through better methods.
- phtrivier 5y agoFair enough. I just haven't fully recovered from the PTSD of "deploying something that reads environment variables at startup" four years ago.
- jswny 5y agoAbsolutely feel that. The `runtime.exs` config that they added a while ago has been an absolute godsend and really fixed 90% of my complaints with deployment. It unified all config for deployments and development and made it all runtime!
- pavel_lishin 5y agoI literally have a Simpsons-Mendoza meme printed out on my desk, except instead of "MENDOZAAAAAA", McBain is screaming "DIALYZEEEEER". What a god-awful piece of software.
- iroq 5y agoIf you're aching for typespecs in Elixir being useful, but are dissapointed with Dialyzer, I recommend checking out my library Hammox: https://github.com/msz/hammox https://github.com/msz/hammox. It's an improved version of Mox, the de-facto mocking library for Elixir, which you can use to automatically assert in tests that your mock calls, or any function calls, fit your typespecs. I personally found that with rigorous enough usage, I don't even miss having actual static typing anymore ;)
- delta1 5y agoThis is great! Thanks for sharing.