Semi-related: I've been using Vue along with Phoenix on the server, and the stack is simply incredible in terms of productivity and ease-of-use. I'm tentatively planning on writing a book that teaches how to use the two together (I call the stack "Vuenix"). Would people here be interested in that?
I've been hearing a lot of good things about Phoenix. I do web application development for a living, so I'm interested in learning more about it.
I decided to take a look at the official getting started guide. Looks pretty good. I like how rigidly everything is organized. Though, there are some things that put me off a bit:
* There are a lot of dependencies just to get a simple hello world app running.
* I need to have a Db installed even though the application doesn't touch a the Db? Does that mean the Phoenix stores its configuration in a Db? I don't like that. I try to keep config in file format.
* Honestly, working with ecto outside of initial model creation looks kind of nasty. I could be looking at this wrong though.
* I've never been a fan of functional languages for one reason: Too many damn symbols in the syntax! It appears that Elixir definitely does a better job having an understandable syntax compared to say, Haskell. That said, the one operator that always gets me is `|>`. I understand what it does, it's just difficult to type and I always felt like a simple `>>` would make sense as well as be easier to type. This is rather nit-picky, but I write a lot of code, so ease of syntax is actually a very important consideration for me.
* There seems to be a lot of lock-in if you want to use the CLI tools. What I mean by this is that the CLI tools, specifically `mix` seem awesome. However, it seems like that in order to use them, you need to use a very specific set of libraries. This isn't necessarily a bad thing, but I wonder if this would effect long-term flexibility.
* Did I mention the dependencies? It seems like every CLI command requires dependencies to be installed. This could be my own misunderstanding or a failing of the guide.
>>I need to have a Db installed even though the application doesn't touch a the Db?
No. You can use an in-memory repo, or a flat file. Phoenix's initial configuration assumes you'll be using Postgres, but that's easy to change/remove.
>>Honestly, working with ecto outside of initial model creation looks kind of nasty. I could be looking at this wrong though.
Ecto is interesting. Coming from Rail's ActiveRecord, it definitely gave me a bit of trouble at first. But then I realized that was because I was thinking of it as an ORM, whereas in reality it's more like a library that maps the data in your database into data structures in your app (I say "data structures" because there are no objects in Elixir, remember). What that means is that it's functionality is not as tightly coupled to your data. Here's a more in-depth explanation (I'm not the author): https://www.amberbit.com/blog/2016/2/24/how-elixirs-ecto-dif...
Over time I've come to appreciate Ecto, because it forces me to think more explicitly about what data I want to fetch/insert and how. It also makes the code easier to reason about.
RE: Dependencies, it's hard for me to say. I can tell you that compared to Ruby and Rails, Elixir and Phoenix are very lightweight. It's true that you need to install some of the underlying language tools such as Mix, but at the end of the day Phoenix follows a more a-la-carte approach compared to Rail's "everything and the kitchen sink" approach.
Phoenix is great because it gives you the same productivity benefits that Rails does, but it doesn't have any of the crazy "magic", which makes it both fast and also easy to understand. When you want to learn about how something works you can pop the hood and read the source code, and it's both well-documented and easy to understand. Elixir is also functional as opposed to object-oriented, which means no leaky abstractions!
I like Vue because it's easy to pick up and it gets out of your way. It's not as complex as React, but still very powerful and extensible. Vue's browser extension is also top-notch.
I like working with them as a stack because they are both very transparent, which makes it easy to reason about when you're passing data back and forth between the server and the client. The only way I can describe it is that it feels very "natural".
Time-wise, it's hard to say. I went through Saša Jurić's Elixir in Action[1] before diving into Phoenix. But that's because I was coming from an object-oriented background (Ruby, some C#) and wanted a bit more exposure to functional programming.
Elixir is a fairly deep language, but you don't need to know it inside out to become productive with Phoenix. Obviously it depends on what type of app you want to develop, but you can probably piece together a simple CRUD app just by reading the official Phoenix guides. Everyone has a different style of learning though so it's hard to say beyond that. Ultimately, just like with Rails, knowing the language itself (i.e. Ruby) will be very helpful once you get beyond the basics.
Specifically, there were a few things that took a while for me to fully wrap my mind around. For example, data is immutable, so loops are written differently. Instead of a traditional for loop to loop over a collection, you would instead use recursion. So if you're like me and are used to reaching for a for loop or a while loop to iterate over collections, you'll need a bit of time to get used to some of Elixir's mechanisms.
Awesome. Thanks for the reply. I'm comfortable with full-stack development when I'm on MEAN but I've definitely been looking to branch out. I think you convinced me to try Phoenix.