3 ms·
Recently I was thinking that the biggest reason this discussion keeps coming up (and is so unedifying) is that many of us have entirely different experiences wi
by matthewmacleod 6y ago
Recently I was thinking that the biggest reason this discussion keeps coming up (and is so unedifying) is that many of us have entirely different experiences with ORMs that colour our views.
I "grew up" using Rails and ActiveRecord. I maintain that (from version 3 onwards) it's absolutely flipping amazing. Can't get enough of it. Never had an issue constructing queries, defining migrations, or dropping down to SQL when I needed to – and generally being able to define and use the entire "database layer" of an application in a robust and sensible manner. Love everything about it.
In contrast, I picked up GORM to use with Go – thinking that I was generally pro-ORM and so it would be a straightforward thing to use. It has been an active impediment to getting work done, and I hate interacting with it. Part of this is no doubt due to my mindset and expectations, so I don't think it's fair to criticise the project itself. But I think it revealed to me that other people might have an entirely different experience with the benefits and costs of using an ORM, and that this is likely derived from both the tools they have used and the projects they have worked on.
I guess the point is… being open-minded about the benefits and costs is always a good thing.
- midrus 6y agoCan't agree more with you. I have the same experience with the django ORM. At work all the Go fans are advocating against ORMs because the exact reasons you give. Then I look at the code they write, and just seeing hand written sql migrations ran by very flaky bash scripts makes me cringe. Let's not talk about all those sql queries embedded in the code....