3 ms·
I think most packages are just as good if not better than their Ruby equivalents these days (and really we can do all of the things you mentioned in elixir), th
by andy_ppp 6y ago
I think most packages are just as good if not better than their Ruby equivalents these days (and really we can do all of the things you mentioned in elixir), the active record pattern is obviously easier to understand than Ecto, but if you know how to write well optimised SQL you never want to go back to an ORM (even if it tries to rewrite your queries for you with magic).
- anhari 6y agoActiveRecord and the scenic gem for database views is a very powerful combination. For the vast majority of queries, you don't need to write optimized SQL by hand. When you do, you can push that work to a version controlled database view, and wrap it in a ActiveRecord class interface and still get all of the ORM niceties.
- andy_ppp 6y agoThe difference here is between two different philosophies: 1) I want the thing to just work, it doesn't matter about underlying complexity, give me the magic and the version controlled database view and the ORM niceties. 2) I don't trust magic as it has bitten me in the arse before, let me make and be able to fix things myself as I'm working at a (slightly) lower level. I'm not saying either is correct but in Phoenix/Elixir magic stuff tends to be kept to a minimum. One man's "for the vast majority of queries" is another persons "will work fine until you need to do something complex". It's all trade offs and I choose mine carefully as I'm sure you do.