3 ms·
Exactly. Or more explicitly, the anti-ORM argument, to me, consists of: ORM works fine for A through W, but SQL is better for X, Y, Z. So rather than just the
by mistermann 15y ago
Exactly. Or more explicitly, the anti-ORM argument, to me, consists of: ORM works fine for A through W, but SQL is better for X, Y, Z. So rather than just the common sense solution of writing just X,Y,Z in raw SQL, everything has to be written in raw SQL.
- wvenable 15y agoThe argument works both ways; in fact, I think it's worse the other direction. Most projects use the ORM and just the ORM and it's against policy to write anything in raw SQL even if it's better for X, Y, Z.
- mistermann 15y agoI'm sorry but I don't think you're telling the truth. I've never encountered in real life, or during any online discussion, the all-or-nothing sentiment from advocates of ORM. Could you link to anything online where an ORM advocate argues that you should never drop down to raw SQL?
- wvenable 15y agoThe attitude is prevalent in the design of many ORMs. I'm both a huge advocate of ORMs and of SQL. A good ORM provides a simple and direct mapping from storage to the object model. But most ORMs go beyond that and try to cover all the query and performance possibilities available from SQL. Some ORMs have their own text-based query language! I've met developers who can happily (and effectively) work with an ORM but hardly even know SQL! They certainly don't know SQL well enough to use it in the situations were it would be most effective. I'm starting to feel like really effective set-based understanding of SQL is becoming sort of a lost art.