5 ms·
Djangonaut learning Phoenix ATM here. My initial thoughts... - way less out of the box. you’ll have to spend sometime getting a boilerplate up and running, es
by sergiomattei 5y ago
Djangonaut learning Phoenix ATM here.
My initial thoughts...
- way less out of the box. you’ll have to spend sometime getting a boilerplate up and running, especially if you’re making APIs, as with solutions like pow aren’t the best for that use case
- having your tests run instantly and webpack or node running on the same process is just life changing
- there is no equivalent of something like Django REST framework for Phoenix, which is annoying, but writing Phoenix is quite productive so it’s all pretty trivial
- ecto has a huge learning curve if you’re coming from the Django ORM
- you will miss the admin panel, and solutions out there are really janky. stuff like Kaffy, ExAdmin... they’re awful.
- documentation is really low tier compared to Django, especially when it comes to Phoenix. I was spoiled by how good the Django docs are and with Phoenix it’s been mostly digging through old forum threads for basic stuff. Docs assume a lot of prior knowledge about the elixir ecosystem, making it hard for beginners, unlike rails and Django. Their docs need a lot of work.
- community can be a little elitist or idealistic. Try asking how to get JWT auth running on elixir forums, watch it get shot down in minutes because “jwt is insecure”. they can be very friendly but also very unhelpful, sometimes lacking pragmatism
- unmaintained packages left and right
- being able to send email asynchronously or do websocket stuff without worrying about memory leaks is just glorious. doing that in Django channels, deploying to production was just a cycle of crossing my fingers worrying that the slightest bug would take down the entire runtime. python async absolutely sucks garbage
I can’t understate that last point. I’ve deployed multiple socket apps with Channels to production, and it’s always been a major pain in the ass on the long run. I spent months debugging a memory leak in Django Channels that only happened in production. Turns out an external package, sentry-python, wasn’t playing nice with ASGI. Async Django is painful and slow. I wouldn’t wish it on anyone.
I have more thoughts written down somewhere, but this is off the top of my head.
All in all: it’s been interesting, very fun. There’s tradeoffs to make, especially in productivity and documentation, but I feel they’re all worth it. Today’s apps demand speed, real-time, and concurrency. Django just feels stuck in a time warp from the last decade and Django channels isn’t progressing fast enough (add that async python is painful).
Maintainability and reliability is important for me as a solo maker. I want a resilient web app that can operate without babysitting, I'm a full time student.
Performance matters to me as well. I can't have a memory leak taking down my runtime every hour, or a slow request causing midnight support emails.
Elixir is just pleasantly fast at everything: unit tests are async, the server is concurrent, everything is just blazing..
Realtime is important for me because you don't always need it, but when you do, it's nice to have it. Knowing that Phoenix has a rock solid implementation makes me use it more. It helps me effortlessly make next-gen products.
Elixir and Phoenix come with performance/reliability guarantees, maintainability and new capabilities like flawless real-time that make it all worth it for me. This is my next upgrade to my stack and I’m really happy with it so far.
- dugmartin 5y agoTrying to live up the Django docs is a big challenge given that Django was started by folks at a big newspaper. I think clear documentation is a core value to that project. I agree that the automatic Hex docs are often a little sparse - they often just document the library API and don't give examples. If you are trying to port websocket code to Elixir/Phoenix I'd recommend the "Real-Time Phoenix" book ( https://pragprog.com/titles/sbsockets/real-time-phoenix/ https://pragprog.com/titles/sbsockets/real-time-phoenix/). It has some hard won knowledge in it (I don't know the author, I just enjoyed the book).
- sergiomattei 5y agoThanks for the book, added to reading list. Currently working on Programming Ecto, really enjoying it.
- sb8244 5y agoI'm the author of Real-Time Phoenix. I appreciate the commenter's kind words. If you ever need any help with content in the book, or a sounding board for Phoenix questions, feel free to DM me on the forums. I appreciate your points and generally agree with them, even the not-so-good ones.
- bostonvaulter2 5y ago> documentation is really low tier compared to Django, especially when it comes to Phoenix. I was spoiled by how good the Django docs are and with Phoenix it’s been mostly digging through old forum threads for basic stuff. Docs assume a lot of prior knowledge about the elixir ecosystem, making it hard for beginners, unlike rails and Django. Their docs need a lot of work. Are there any concrete areas of the Phoenix/Elixir docs that you could point to? I'd love to make some doc PR's to make it more understandable, especially to Elixir beginners. > there is no equivalent of something like Django REST framework for Phoenix, which is annoying, but writing Phoenix is quite productive so it’s all pretty trivial It's not quite ready yet, but I'd recommend keeping an eye on https://www.ash-elixir.org/ https://www.ash-elixir.org/ It'll even generate an admin for you: https://www.youtube.com/watch?v=aFMLz3cpQ8c https://www.youtube.com/watch?v=aFMLz3cpQ8c (although I haven't used django so I can't compare it to that, although I hear good things about django's admin) > community can be a little elitist or idealistic. Try asking how to get JWT auth running on elixir forums, watch it get shot down in minutes because “jwt is insecure”. they can be very friendly but also very unhelpful, sometimes lacking pragmatism Yeah this makes me sad sometimes. > Maintainability and reliability is important for me as a solo maker. I want a resilient web app that can operate without babysitting, I'm a full time student. Great point! Have you written about your web app anywhere? I think solo development of an application is a really interesting space that I'd like to investigate further at some point.