Recently I came across a few members of the Elixir community saying that they prefer composing their applications as umbrella projects handpicking the components they need instead of using frameworks like Phoneix.
A few examples are this post by Rob Connery http://rob.conery.io/2016/03/16/more-adventures-with-otp/ or the latest Elixir fountain episode with Dave Thomas:
I like this approach since it gives me more control on what the application is going to look like instead of making me fit my application in what the framework prescribes.
What is your favourite approach? Do you start from scratch and just pick what you need as you implement your application or do you always use Phoenix knowing it has everything you might need (and possibly more than that)?
It’s convention vs. configuration problem all over again
Lately I don’t think of Phoenix as a framework anymore. It’s so lightweight and basically only include what’s necessary for building web apps. It doesn’t even have authentication module on its own. Compare it with, say, Laravel or Django. Many also have said that it’s less magic-y than Rails.
My approach is to start with
mix phoenix.new, then add/remove libraries and refactor as necessary. Less configuration stuff to think about, more time to actually develop something. I think this was kind of Rails’ pitch (never used it before)?
Also, refactoring in Elixir, even from/to umbrella apps, is oftentimes a breeze, so you might defer the decision later and still not miss much.
mix phoenix.new generates first and foremast an elixir application, with phoenix as a dependency. Phoenix in no way prescribes what your elixir application looks like or how it should be built. A discussion of libs vs frameworks is fine, though I don’t see it as productive because folks have different definitions for these things, but let’s at least frame the discussion around phoenix properly
In defense of Phoenix, it is pretty configurable. In contrast to Rails, where you have mostly empty project and require external library files, it does scaffold some boilerplate code that you can tweak directly, getting rid of stuff you don’t need. It’s a big difference that makes a framework way more hacker-friendly, and less limiting.
For now I start with an umbrella app with two apps:
interface: phoenix - no ecto
domain: no phoenix - ecto
Thanks to everyone for your answers.
By they way, I didn’t want to criticise Phoenix. I think it’s a great project, it’s just that most of the time I don’t need everything it uses by default and it’s great that it’s possible to pick just what I need.