Re:Elixir for Humans Who Know Python
by arrowsmith on Saturday February 25, 2023 @01:31PM
(#34939144)
Phoenix doesn't have the concept of a "model". The functionality of what Rails (and I guess also Django? Idk) calls a "model" is split between a few different places: schemas, changesets, queries, the repo.
It felt weird at first, coming from Rails, but after getting used to it I don't miss "models" at all. ActiveRecord models in Rails are a vastly overloaded concept anyway and pretty much always degenerate fast into an ungodly mess as your app grows. I prefer Phoenix's approach.
Yeah, for a big complicated system, I don't think defining everything in models is great. I don't do that, and it's also not how fastcomments is built.
But for simple stuff it's amazingly productive!
I'm not really familiar with Phoenix, but skimming through the section linked below, it seems to cover what you're looking for? Basically, you use a tool to generate your model + migration code and then run the migrations.
https://hexdocs.pm/phoenix/ecto.html#using-the-schema-and-mi...
As for the comparison to Django, I don't really expect any web framework to have docs at that level. They are simply huge and have been around for quite a while.
Yes, I skimmed through that and was surprised to see it be compared to Django. It's different.
Django is for building CRUD apps quickly. That's it. It's not for the long haul of super complicated apps, which many projects don't ever reach before they fail/get abandoned.
99% of line-of-business apps are CRUD. There's nothing special about "super complicated apps" that isn't brought in by the Python ecosystem. Where exactly do you think Django fails in that regard?
I love Django. I just think Python without types makes things hard at scale.
MyPy and friends have made this much, much better. In the long term it's probably not ideal for very large systems in many applications.
I've been using it with an IDE and it's quite nice. I'll probably be using Django for a lot of future projects.
I agree that there are better options for long-term maintenance of large projects, but let's not act like Youtube or Instagram don't exist - both of which used Django to some (high at the beginning) degree.
Re:Elixir for Humans Who Know Python
by bostonvaulter2 on Saturday February 25, 2023 @05:32PM
(#34941125)
You might be interested in the relatively new Ash Framework that builds on top of Phoenix and has much more built in: https://ash-hq.org/
That's completely opposite what Django does, and that's partly why Django is so productive.
I don't think Pheonix and Django are competitors. They are too different.