Just an FYI, most of the older tutorials and guides are still compatible with the current version of phoenix.
Yeah, I have all the books except for Ecto Cookbook. It’s been awhile since I looked at it because I tried emailing the author about a problem that I had and never got back an answer so I kind of rage quit after that. It was about the acceptance tests not working with Hound but this was awhile back and I’m willing to bet something has stabilized by then so I’ll try looking over everything again while it’s the weekend.
@kennethuy Interesting. I recall that I was getting some kind of error with Hound, and it went away when I installed phantomjs via npm, instead of
apt-get was installing version 1.9, at the time (about a year ago). Using npm installed version 2.1. So you might try using
npm -g install phantomjs-prebuilt (you might need
sudo), instead of
sudo apt-get install phantomjs (if you’re on Ubuntu), as instructed in the book. However, like you said, things might have stabilized, by now, and either command might be fine, now.
Hello @chrismccord, thanks for chiming in!
Yes, I’ve read the guides on the official site, they are well written and well structured (thank you for that) - I’m also complementing my learning with
Programming Phoenix 1.4 (currently in Beta in PragProg).
The information I’m specifically looking for is related to how to build REST APIs; I know that I could use most of what’s in the official documentation, but sometimes it feels like it’s too much information to digest if I only need to build APIs - Also, I don’t have plans to build a complete site (backend + frontend) using Phoenix at the moment.
Thank you very much, and let me know if I can help with something else!
Looking forward to your response
Also, I consider that I learn more by doing, so having a small project around building something close to real world with best practices will be golden.
I know that building that kind of tutorial is quite difficult and time consuming - please don’t feel like I’m demanding it or something like that
+1. I could be wrong but I don’t see any Phoenix samples included. I was looking at the Iris framework recently and the collection of examples is really impressive (still prefer Phoenix though ) . https://github.com/kataras/iris/tree/master/_examples
My background is with JS, Rails, MySQL for medium sized projects. (Clients with approx GBP 50M turnover)
Moving from the above to Elixir the biggest challenge for me has been getting my head around Functional Programming. I’ve read a lot of stuff on the subject and every time I think I’ve ‘got it’ and then try putting it into practice I’m struggling.
I think what help me would be a guide which showed various software patterns in a procedural (pseudo) language and then an equivalent FP version. That would help immensely.
In my view it simply doesn’t work that way
- the core of procedural/imperative programming embraces mutability and iteration
- the core of functional programming embraces immutability and recursion
So the constraints are quite different which means that a different way of doing things is required - so the mindset for the functional way needs to be built from the ground up - typically starting with tuples, lists, how to operate on them and how to compose them. Ultimately I suspect that is what Learn Functional Programming with Elixir (Pragprog) is for.
Every once in a while there seems to be an equivalency like that the strategy pattern is the OO equivalent of higher order functions - but those are few and far between.
Scott Wlaschin’s Functional Programming Design Patterns is a great talk the should be regularly revisited.
@peerreynders Many thanks for your response. I already have the Pragprog book that you mention. As I said, each time I read this stuff it makes sense but when I try to put it into practice I struggle.
Perhaps I’m too far gone done the imperative route to change tracks. I do hope not.
I do understand what you are saying about there not being easy x-refs between FP and imperative.
Oh well I’ll just struggle until it falls into place.
It’s simply a matter of determination - unlearning acquired habits can require significant effort.
I’ve been “visiting” Haskell since ~2000 and while early on that introduced me to the idea’s of
filter it just seemed too strange from where I was at (C, C++, Java, C#) to feel that I could “program Haskell” when I hit Real World Haskell (these days go straight to Haskell Programming from First Principles).
Even followed F# since 2005 - but in hindsight I believe its association with the .NET framework made it too easy (and to some degree necessary) to stick to the old imperative habits (straight OCaml may have been a different story).
So it wasn’t really until about late 2015 when I tried Clojure that things started clicking. It embraced immutability and I wasn’t getting bogged down with adapting to a real type system (classes aren’t types etc.). So I’m inclined to say that one may need to find a language that is different enough to keep one away from those old habits (e.g. Racket) while not going so far that you are totally lost (e.g. Haskell).
To a certain degree Elixir’s Ruby-like syntax and name rebinding can make a certain imperative style more easily possible. So if you do find that even after Learn Functional Programming with Elixir (Pragprog) (though doing the exercises should certainly help) it doesn’t quite click maybe take a detour into Erlang - to move into even more unfamiliar territory - like with Learn You Some Erlang for Great Good!.
Other than that seek out small focused katas - some people seem to like exercism.io to learn more by doing.
Hi @nexar, I found the first half of Dave Thomas book Programming Elixir (Pragprog) invaluable as a Ruby developer to initially “get it”. As @peerreynders alluded to it is best done from the ground up focusing on data structures, immutability, recursion, and pattern matching. It took me a little time to think in terms of
reduce and recursion instead of imperative
for loops relying on mutable index but in his book he has a lot of exercises for each chapter which really helped speed up the learning process.
I believe a HUGE part of my problem is that I still need to work with my current toolset on a day to day basis and therefore switching between the 2 different paradigms is perhaps proving more difficult than it needs to be. I’ve some ‘holiday’ time coming up which I hope to use to immerse myself in FP and see if that complete divorce from the ‘old ways’ will help.
Many thanks for all your comments and suggestions.
Although I am not an expert with JS and had (I think still have) some issues grasping asynchronous JS, I would complement @peerreynders links with these that I found a month ago and helped me a lot:
I guess one of the most difficult things in Elixir (and Erlang) is to accept and adopt the “let it crash” philosophy/mindset, it’s just so different from any other programming language. The concept itself is simple though.
Sorry it’s taken me so long to get back to this! But I have finally put up my thoughts/tips for learning
Hopefully it covers the two points I touched on in the original post of this thread:
I found out my lack of patient in reading the document have caused me to make several false statements about phoenix.
One such false statement was how scatter the information is to add role. Yet the package I’m using, Coherence have a doc on the github page which give an example of using Canary package in tandem to Coherence to do exactly what I want. To be fair this is only on github it doesn’t seem to be on hex.
I think I should be blogging about what I’ve encounters and solutions as a newbie to help other people new to phoenix.
Hey, I’m 3 years late to this but I guess it is better if I reply here.
I personally find it hard to remember all those things, mostly because there aren’t a lot of examples or guides about actually building some proper projects using OTP, so I usually have a hard time remembering what I learned.
8 posts were split to a new topic: My thoughts about Elixir/Phoenix
Ughh. Real World Haskell. Here’s a review from amazon:
This is one of the worst programming language books ever… its almost useless.
In my experience, it was worse than that. “Real World Haskell” permanently soured me on learning Haskell. I have a permanent grudge against the Haskell community for foisting that book on people trying to learn Haskell.
My path to understanding FP was taking one of those free online courses when Massive Open Online Courses (MOOCS) were all the rage. Of course the FREE part of the model was unsustainable, so right after I finished my course, they started charging for courses. The course I took was on Erlang, presented by the FutureLearn website, which was taught by Simon Thompson, one of the authors of “Erlang Programming”. Struggling mightily for two months with Erlang is what got me on my way. Personally, I would recommend learning some Erlang before trying to learn Elixir.
Always deep dive in Macro and Stream in elixir are difficult for me
I love this topic. One thing that helped me tremendously: stop overthinking…
I was always trying to see some super complex rocket science behind everything in Elixir and Phoenix. It took me years, but then I started to see the genius behind how simple yet powerful things are. It was almost laughable when I was re-reading the docs then – I was like OMG, it’s literally been written here word by word how it is and how it works for years, there’s not a single word missing or redundant. It’s like listening to Dvorak’s symphony Why was I unable to see it for so long?