News for hackers. Stuff that matters.
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by poisonta on Tuesday May 18, 2021 @08:46AM (#27193847)
In addition to that, I struggled to find a well maintained library similarly to Devise. Also, many people won’t agree to me, but Ecto is also a kind of pain. I think Phoenix would have been in a better position if there were libraries like ActiveRecord and Devise.
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by subbu on Tuesday May 18, 2021 @01:13PM (#27197817)
I struggled with Ecto. It seemed too complex. I missed find_by_sql and the scopes of ActiveRecord. But once I went past the initial learning curve Ecto is a seriously well designed library. I have not written a single sql query by hand. Now I feel find_by_sql is an anti-pattern as I was mixing sql with ORM.

Once your database becomes sufficiently complex you start writing a lot more sql.

ActiveRecord's way of chaining scopes to combine multiple scopes is brittle. You can't customize the conditions. Ecto solves this by giving you composability. You can build on top of your earlier commands. If you combine this with pattern matching in the functions or Enum.reduce you have an extremely powerful and a flexible query engine.

Ecto also relies on the strengths of underlying database engine rather than treating it as a black box. If you are dealing with 100s of tables Rails way of polymorphic design doesn't give you referential integrity. I like Ecto's recommendations: https://hexdocs.pm/ecto/polymorphic-associations-with-many-t...

Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by hnedeotes on Tuesday May 18, 2021 @08:55AM (#27193921)
Probably there's no one in the Elixir community with enough know how to build a Devise-alike lib, it's what it is.
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by cpursley on Tuesday May 18, 2021 @09:07AM (#27194058)
Uh, I shouldn't have to point this out but Elixir was created by the people behind devise...
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by pmarino90 on Tuesday May 18, 2021 @08:59AM (#27193960)
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by hnedeotes on Tuesday May 18, 2021 @09:01AM (#27193977)
The problem with the internet is that you can't markdown irony...
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by pmarino90 on Tuesday May 18, 2021 @09:04AM (#27194017)
ahah sorry about that! I merely wanted to add that to the conversation but I should've replied to the previous message.
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by dasil003 on Tuesday May 18, 2021 @09:06AM (#27194037)
Is this a joke based on the fact that the same person created Elixir as Devise?
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by brightball on Tuesday May 18, 2021 @09:04AM (#27194021)
Jose Valim, the creator and primary author of Elixir, actually wrote Devise.
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by yoneyone on Tuesday May 18, 2021 @09:04AM (#27194025)
Jose Valim, creator Elixir, was one of the core developers of Devise...
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by alexcp_ on Tuesday May 18, 2021 @11:55AM (#27196395)
That's the joke
Re:Ask HN: Are you satisfied with Elixir or do you regret ch... by cultofmetatron on Tuesday May 18, 2021 @11:35AM (#27196082)
I've been able to drop in pow with ease and have everything I would have gotten from devise.

That said, the community is moving towards phx_gen_auth which jose himself wrote and will come out of the box with 1.6