3 ms·
How often is the ORM generating junk? To say that the ORM is useless because occasionally it doesn't generate performing code (with EF and Linq more often than
by scarface74 9y ago
How often is the ORM generating junk? To say that the ORM is useless because occasionally it doesn't generate performing code (with EF and Linq more often than not it does generate performant code) could be applied to any high level construct. But I don't see people giving up modern languages to go back to writing everything in Assembly or even C.
Yes I optimize when my automated performance testing/stress testing, tells me I need to and may write handcrafted sql, but I've also handcrafted some classes in C back in the day when my old Windows Mobile app using the C# compact framework wasn't performing.
- zimpenfish 9y ago> How often is the ORM generating junk? From what I've seen (couple of home-grown ones, Class::DBI, ActiveRecord), "more often than you want". (I'm willing to admit they may not be class-beating examples. :)
- scarface74 9y agoI meant a good ORM. But then again, my definition of a good ORM is an ORM with a language that treats queries as a first class citizen. EF with Linq doesn't really act feel like a separate framework since Linq and Expressions are built into the language.
- zaphar 9y agoThose are more of a query framework than an ORM. If that's your bar then most ORMs are going to fail to meet it.
- scarface74 9y agoHow is it a "query framework"? Linq works with objects and the Linq expression provider treats the Linq as data that translates the objects to Sql at runtime. That is by definition an Object Relational Mapping. Of course most ORMs do fall short because most languages don't have the powerful concept of "code as data".