3 ms·
I agree. The OP seems to fall into the camp that, if ORM can't replicate everything that you would do in native SQL, then therefore ORM is bad. Which is absol
by mistermann 16y ago
I agree. The OP seems to fall into the camp that, if ORM can't replicate everything that you would do in native SQL, then therefore ORM is bad. Which is absolute nonsense of course.
I just don't see how the pure SQL people and ORM people are philosophical opponents, other than how ORM tools make dealing with SQL (which is an awesome, proven technology) so much easier, I suppose it could theoretically be a threat to their livelihood. The way I see it, they are partners in the same cause.
I'm the same as you, I write applications that need to store and interact with data. The difference between using an ORM or not is like light and day, and for me, this constitutes 90% of my work. Certainly, there are situations where it is just common sense to drop down to raw SQL (and if your ORM doesn't support this, you are screwed), but people like the OP seem to subscribe to the "throw the baby out with the bathwater" philosophy of life....if you can find a single problem with a solution, throw the whole thing out.
This is one of those arguments that will never, ever go away. I used to be passionate about the subject, but I don't care much anymore. The anti-ORM people will continue to say it doesn't work (ever), while the pragmatists will continue to use ORM because it does work, and for the edge cases, they will drop down into pure SQL, which most developers know very intimately anyways.
On a related topic, how many DBA's have you met that understand SQL, query plans, etc deeply, and have a strong knowledge of database system tables (as well as you do as a developer?) Most DBA's I've met basically follow: http://en.wikipedia.org/wiki/Argument_from_authority http://en.wikipedia.org/wiki/Argument_from_authority
- wlievens 16y agoThe reason pure SQL people and ORM proponents don't always get along is that ORMs make it very easy to write really crappy queries. I'm fully in the ORM camp, but it is true that I can't turn on SQL statement logging without being terribly embarassed. And tuning and optimizing these queries isn't always as trivial as some make it sound. For fetching some data, it's not terribly hard, but try explaining to Hibernate that you want to bulk delete a bunch of objects (with inheritance) without screwing up your session...
- kunley 16y agoIt's all about people, not the ORMs or other technical inventions. Most shithead queries I encountered during years of DBAing were written by hand by poor folks abandoned by their colleagues and over-confident managers. Just no one cared to educate them, but everyone expected "progress" from them. So they did what they could.. In fact I wished many times that they used some abstraction layer which would save them from doing such harm, simply because this layer would be written by more educated people.
- steveklabnik 16y ago> I suppose it could theoretically be a threat to their livelihood. Bingo. Every time I've seen someone hating on an ORM, it's always a DBA. You wouldn't believe the number of queries that I've written by hand while thinking "ActiveRecord would have just written this for me" because An ORM Couldn't Possibly Be Performant Enough For Us!