Can I learn / use Phoenix without fully learning all that Elixir has to offer?

Hey all,

First post! I really fell in love with Elixir and Phoenix, and the community as well.

So here’s my problem: I’m a front end developer by trade. Elixir (Phoenix) will be my first backend language that I’m seriously trying to learn (I’ve tried before with python and php earlier in my career, but quickly lost interest, half because of the api / documentation, and half because once I learned, I didn’t know of anything interesting I wanted to build.

I want to learn Elixir & Phoenix to build websites. So I’m about 100 pages into the Programming Elixir book by Dave Thomas, in addition to 52% into the video Hangman course by Dave Thomas (I started with the course, then tore open the book as I wanted them to go more over data structures, pattern matching, and recursion).

The problem I’m having though, is the same one as always: I’m being confronted with tons of “Enum” methods which I have no chance of ever remember or caring about. I want to just start actually using Phoenix to build a site.

So my question is: do I for some reason need to completely finish this Elixir book before I move onto Phoenix? Or should I just finish the course and that would be good enough?

3 Likes

Hey Reynard, welcome! :023:

The answer to your question is ‘yes’, but, I personally feel that will be harder - but it really depends on how you learn best. Some people love to get stuck in and start building things and read no books at all, others (like me!) prefer to read as much as I can about a technology (even if I don’t remember it all) so that I have a good overview of what is possible and then I can just look things up when I need to, or ask questions here on the forum which would help jog my memory.

So it really depends on how you approach learning :slight_smile:

Rather than repeat what I have posted in another thread, here’s what I have done so far and what I highly recommend :003:

2 Likes

Thanks. Just bought the Phoenix book, and also bought the Learn Functional one with your recommendation.

Yeah I fall somewhere in the middle, though more towards struggle. I have a hard time focusing on anything being taught, without it being grounded with a problem… and often times, a book going “hey! you can take this thing, and turn it into this other thing” is immediately met with a “well why would I ever need either of those things”. So for me, it’s easier to struggle just a tad bit more, so that as I encounter things I want to do, or challenges I face, I can then go find the solution, and then I “get it”… it’s not some throwaway example that doesn’t make sense in a bigger grand scheme.

That being said, reading the forum… I found one guys thoughts which I really think echo’d my sentiments: Programming Elixir seems to be a more exhaustive tour of the full language than other books. I’m looking for a book that puts more pen to pad… so for my own learning style, reading Elixir in Action, and Programming Phoenix, while putting together a site for myself, may be the best course of action… then when I get a little bit more grounded, I can come back to Programming Elixir.

1 Like

Sounds good :023:

Let us know how you get on and if you get stuck you can always post a thread :slight_smile:

You could actually read 50% of Programming Elixir, then 50% of EIA, then the remainder of PE and the remainder of EIA - that’s what I did :003:

For me, the important thing is trying to understand everything I read (even if I don’t remember it) I don’t actually move on to the next chapter if I haven’t understood most of the previous chapter. I think I am very stubborn!! if I don’t understand something I will re-read the chapter or that particular bit until I do!! You could probably argue that it doesn’t do me much good because I end up forgetting the majority of it :043:

Please let us know how you get on tho - I’m always interested in the approaches of others when it comes to learning.

1 Like

IMO any time you might save now you will repay tenfold down the line in the future. Not worth it.

I went through the official Elixir tutorial in one long weekend afternoon.

5 Likes

Think about Rails. There are a bunch of people were actually using Rails first, then learnt Ruby. I believe this could be true for Phoenix and Elixir if you have some programming experiences.

One good thing about it is by then you have real problem to solve like ‘How do I update those data without variables’ or ‘I have been do this for many times, how do I DRY it’. After you find and applied the answers, you will remember them deeply. Or anytime you are not feeling like building website for the day, read one chapter/section of Elixir.

(Yeah I mean I tried a bunch of functional programming languages from time to time, always forget their API after several months because I never actually use them that much)

5 Likes

Don’t try to remember that! That’s definitely not a good way to learn anything related to documentation.

I don’t believe that you would need to pay for anything and read any books. Of course they are awesome and would help a lot, but you can definitely deal with Elixir without them.

Here is my general proposition:

  1. Firstly learn basics (like guides from official website). You can’t use Phoenix without Elixir, so its definitely required.

  2. After it take a look at least one good website for learning Elixir like ElixirSchool. After that your knowledge should be enough to learn on your own way faster or slower.

  3. Once you read them you should (it’s not requirement) read whole Elixir API module by module.

    Of course you should not remember anything of that. You should know that something like this (here: specific function) exists, so when you are stuck then you can return back to specific documentation much more faster - that’s point - it’s basically your learning optimization i.e. if you know what you want to find then it’s already 90% of your research. :slight_smile:

  4. After that I recommend to read some forum posts and Slack conversations for example elixir-news. I think that @josevalim explains best his ideas and takes lots of his time to answer questions even from beginners. Being so close allows you to understand way of programming in Elixir like why this is introduced, why it has biggest priority, why this should be implemented as standalone library etc.

  5. If you are going to use database go to step 1, but change Elixir to ecto. Welcome in infinite loop. :smiley:

  6. At this step take care of Phoenix guides. It’s your final step. I don’t believe that there is quicker free way to write good Elixir code and use Phoenix.

Make sure you consider also optional steps. They are like friends in MMORPG games which can level up you much quicker. :smiley:

Other threads which may help you:

  1. What is your number one tip for anyone new to Elixir?
    I think it’s related thread. Some tips always under price. :077:

  2. Why Enum.filter_map is deprecated?
    I choose this one as a simple example of thinking in core team.

  3. Your Elixir Tips Thread
    Again tips … Is it déjà vu already or just another my SPAM tip? :slight_smile:

  4. function - Returning values in Elixir? - Stack Overflow
    This is important example especially when you used another language before. Elixir is much easier to learn in my opinion. It’s like a cat i.e. really cute syntax, but follows its own way. :077:

  5. Elixir's biggest gotchas?
    The biggest gotcha is actually not read this thread! :smiley:

10 Likes

Somehow it feels like you need to work this in:

Learn to Forget (when you learn Erlang)

2 Likes

@peerreynders: Honestly in my own opinion I’m not sure if anything from Elixir core should be forget at all. Elixir is written in a way to be extendable, so you can use once library and forget it, but I don’t believe that you should totally forgot about Agent or any other module.

Of course some of them are used more often (like Enum), but this does not mean that only top n should be remembered. When you contribute to multiple open source project you have different project assumptions which requires different solutions. Sometimes you need to use Agent and sometimes something else. If you are working on tools and GUI (like scenic) then you could touch phoenix guides and forget about it, but same rule does not applies to Elixir core API.

Erlang have much more modules and its API does not look so nice comparing to Elixir. Even PHP pages had much better theme (yeah, I like dark themes), so remembering everything from Erlang looks like much more harder. Fortunately Elixir have awesome documentation and it’s pretty easy to keep documentation basics in mind in order to quickly navigate to the right page.

Maybe another way of explaining this … Every Elixir full stack developer should answer himself/herself if he/she could describe in his/her own way with few words every DOM element by its name and every module from Elixir core documentation.

1 Like

My interpretation, for example:

  • You have to learn/understand recursion even if in the future you will favour using higher order functions.
  • You have to learn about spawn, send, receive and link before moving on to Task, GenServer and the like.

In a way it’s a caution that there will be times where you are learning material that won’t seem to have any frequent, direct, hand’s on use in the future but that you have to be exposed to in order to fully grasp what is going on.

For example, trying to use GenServer before fully grasping how a process based on a receive loop works is just not a good idea. This is where focusing on trying the learn/isolate the 20% that you will be using 80% of the time will get you into trouble.

2 Likes

I think if you had a project idea in mind, this type of question ends up being answered before it’s even asked.

You don’t necessarily need to read an Elixir book or take a course before you can start using Phoenix because you can just use your project idea to fuel your questions as they come.

For example, instead of trying to go Matrix-style and consume 1,000 pages of books to say “I know Elixir”, what if you just approached it from the natural problem / solution style?

Let’s say you wanted to create a todo list app (I know, boring).

How does that start? It starts like any app, and the problem is “how do I create a new Phoenix app?”. Now you Google for “how do I create a new Phoenix app?”.

And you’ll likely come across having to install Elixir first, as a side topic. So you do that.

Then, the next step is “how do I run a Phoenix app?”, so you Google that and find the solution.

The next step after that might be to skim through the files that were created and look for things that look familiar to you. Perhaps one goal could be to modify the default page, and set up your own custom theme since you’re already a front-end developer, that should be familiar.

Now you get motivated and fueled by real progress instead of reading about Enums for an hour.

Anyways, keep doing this for a while and before you know it, you end up with a finished project, and you research things as you go. Eventually you might end up reading about Enums, but it’s only in the context of a real problem associated to your project, so it’s much different than just pre-reading about it in a book.

This style of learning is how I do go about things and I’ve been a web developer for 20 years. It’s also how I picked up Phoenix on the side without ever reading an Elixir book. I’m hardly a hardcore pro at it, but between reading docs, looking at examples and asking questions from time to time, it’s enough of a base line understanding to get real stuff done.

3 Likes

6 Likes

Here’s a Hacker News thread from a guy who’s done just what you’re talking about (he says he doesn’t know OTP/concurrency stuff yet at all and just dove right in to Phoenix).

The site in question: ficdb.com. Nicely executed, right? He’s kindly open sourced it. So what you’re talking about can be done. I imagine that if his site were focused on live interactions between people for example that he’d have taken a step back and studied Elixir and OTP/concurrency more. And I might be wrong but I’d guess that he’s starting to learn Elixir, OTP, and the rest of it more deeply now.

3 Likes

Thought I’d seen ficdb.com before :smiley: it was made by @makeitrein and he mentioned it here:

3 Likes

I’m on the same boat as you, started learning Phoenix just a few months ago whenever I could find time. So, I’m still learning Elixir, Phoenix, Ecto, and the ecosystem in general.

I also thought that I could learn Phoenix without much of Elixir. However, after spending a little time with the framework, I came to the conclusion that even if I could, I didn’t want to do that anymore. There are many reasons for that, but these three come to mind at this moment:

  1. Elixir is awesome. I haven’t felt this way about a language since the early days of Java - don’t judge, if you’ve spend your days programming DB based applications in C++, you’d have loved Java as well :slight_smile: I found it impossible not wanting to learn more of the language

  2. The BEAM and especially OTP are remarkable pieces of engineering. I just regret not finding about it ten years ago. Not only you can build something that performs and escalate, but you do that knowing that the end result will be reliable, fault tolerant even. Elixir makes it a lot easier to use.

  3. If you really want to build just “web sites” there are plenty of languages and tools for that. But, if eventually you want to move to something more complex, you probably want to follow the “Phoenix is not your application” method (or mantra if you wish). By doing that you’ll find yourself thinking about your domain problem right at the beginning of the development cycle. And, by the time you bring Phoenix into the picture, you probably feel pretty confident about the system you have built.

This is why I’ve put my Phoenix book in the shelf, and I’m up to my third book in Elixir :slight_smile:

Good luck

4 Likes

If you have trouble coming up with a problem that is interesting and feasible for you then you might want to take a look at exercism.io they have a good Elixir track and will help you right idiomatic Elixir code for fun little problems. I like the problems better than something like project Euler because they aren’t overly mathematics focused.

2 Likes

I’m a bit of a “jump into the deep end” kind of guy, but I started by reading Programming Phoenix (I also have quite a bit of front-end experience). While the book focuses more on web apps, you absolutely get introduced to core Elixir concepts along the way, but you get to build something tangible too. I even subbed out the controller logic of the examples for a GraphQL schema (check out the Absinthe library). The Elixir documentation is great, so you’re really only a Google search away from digging into pattern matching, what a tuple is, guards, etc…

In my opinion, way too much “check this language out” discussion about Elixir is low level performance, and zeroes in on the nuts and bolts of concurrency, self-healing, etc… While that stuff is GREAT, I think for most people new to the language, it’s better to start the productivity aspects.

Lastly, here’s an article I wrote touching on this a bit more:

https://edgewise.engineering/choosing-elixir-5c1f4052dd28

and a podcast where I go into it a bit more:

https://devchat.tv/elixir-mix/emx-014-choosing-elixir-with-bobby-juncosa/

1 Like