Live data from Hacker News

On to Elixir

thraxil.org

11–20 of 41 posts

Re: On to Elixir

#11
post #6

Last time I looked Ecto didn't have automatic migrations I think. Does it now? I can't imagine working without this feature after many years of Django...

No and it is not on anyone roadmap. So far we have not had anyone that found a way to make it work well.

Re: On to Elixir

#12
post #6

Last time I looked Ecto didn't have automatic migrations I think. Does it now? I can't imagine working without this feature after many years of Django...

It takes the more Rails-like approach where you run a mix command to generate a migration (and that potentially writes out an elixir module with the Ecto schema, eg, when defining a whole new table) rather than Django's approach of updating your `models.py` and then having `manage.py makemigrations` introspect the DB and generate the migration code from that. I do slightly prefer Django's approach, but it's an easy adjustment to make.

On the other side, `mix ecto.migrate` essentially works the same as `manage.py migrate` for bringing your database in line with the set of migrations in your code.

Re: On to Elixir

#13
post #2

I agree with the code generation of libraries in Phoenix being a drawback. I think it maybe a reaction to there being too much magic in Rails dependencies, but it makes upgrades much harder.

A lot of that code generation is to facilitate macros. Personally, I don’t like macros when a little extra code to make a function call would work just fine.

Might be misunderstanding code generation. This means literally writing code into your project via a script. It has nothing to do with macros.

Re: On to Elixir

#14
The point about code generation into the project is unfair. The only library I'm aware of that does this is phx_gen_auth, everything I've used works exactly as described. phx_gen_auth takes this approach due to José's experience working on Devise for Rails, which mirror's mine as a user. I overrode almost everything in Devise, often in very messy ways. While the difficult-to-upgrade argument is a sound one, once you've over-written a massive chunk of a library anyway, upgrading is no easier.

Otherwise, great article about Phoenix!

Re: On to Elixir

#15
post #6

Last time I looked Ecto didn't have automatic migrations I think. Does it now? I can't imagine working without this feature after many years of Django...

I don't know why this is always talked about as if it's some killer feature. You still have to review the migration its generated, don't you? Don't get me wrong, it's a nice feature that I would use if were available, but certainly not even on a list of dealbreakers for me when evaluating a framework.

Ash framework [0] does have this feature, though.

[0] https://ash-hq.org/

Re: On to Elixir

#17
post #8

I’m surprised to see that the OP, as a Django user, does not call out the lack of an out of the box admin tool that’s not there in Phoenix. Django’s admin is amazing and super useful in production. I love phoenix but I miss an admin tool :(

The Django admin has unfortunately stayed stagnant for 15 years. We built a replacement admin in iommi first almost as a joke, but now it's a serious part of the framework. Our admin is 645 lines of code (54 of which are imports!) while djangos admin is 5307, and still our admin is way more customizable. Not only that, but you can easily reuse all those customizations if you want to lift stuff out of the admin to you…

Could you consider releasing it into the open source?

Django admin is stagnant mostly because of lack of uptake in support from companies. Everyone makes their own admin solution rather than collaborating.

Re: On to Elixir

#18
post #6

Last time I looked Ecto didn't have automatic migrations I think. Does it now? I can't imagine working without this feature after many years of Django...

I don't know why this is always talked about as if it's some killer feature. You still have to review the migration its generated, don't you? Don't get me wrong, it's a nice feature that I would use if were available, but certainly not even on a list of dealbreakers for me when evaluating a framework. Ash framework [0] does have this feature, though. [0] https://ash-hq.org/

The people who talk about it consider it to be a killer feature. I certainly do. There's considerably less ass pain and fear involved in Django migrations.

Re: On to Elixir

#19
post #9

I’m surprised to see that the OP, as a Django user, does not call out the lack of an out of the box admin tool that’s not there in Phoenix. Django’s admin is amazing and super useful in production. I love phoenix but I miss an admin tool :(

Author here. I do love me some Django admin, but I find that I tend to use it a lot early on in a project and then slowly move as much away from it as possible as we build up more specific admin/management-type functionality in the app itself. I also would probably include Django Admin in the "app ecosystem" stuff that I do call out. I think if Phoenix had a similar ecosystem, there could easily be something like Dja…

There is! Andy Glassman talked about this at Empex NYC (that I help organize btw!) https://www.youtube.com/watch?v=3c9kMmxeSA0

The tool Andy uses is called kaffy https://hexdocs.pm/kaffy/0.5.0/readme.html

Re: On to Elixir

#20

Earlier quoted context omitted.

I don't know why this is always talked about as if it's some killer feature. You still have to review the migration its generated, don't you? Don't get me wrong, it's a nice feature that I would use if were available, but certainly not even on a list of dealbreakers for me when evaluating a framework. Ash framework [0] does have this feature, though. [0] https://ash-hq.org/

The people who talk about it consider it to be a killer feature. I certainly do. There's considerably less ass pain and fear involved in Django migrations.

As I said, I would use it if it existed. But I have never experienced anything close to fear when writing migrations, that sounds insanely hyperbolic. The most I've experience is very mild pain.

There's also the thing that schemas are not 1-to-1 with tables in Ecto (I realize it's possible in ORMs too, but not as ergonomic). Sure, you don't have to do this, and many don't, but it's very useful.

Post reply on HN