3 ms·
I agree although I think the biggest problem with ORMs is they’re super hard to debug and reason about. You get all kinds of awful SQL out of them you might not
by overgard 8y ago
I agree although I think the biggest problem with ORMs is they’re super hard to debug and reason about. You get all kinds of awful SQL out of them you might not expect
- threeseed 8y agoI've been using ORMs for nearly 20 years going back to WebObjects days. Have never seen, not once, any ORM that doesn't make it trivial to print out the SQL to help with debugging the generated code. And I've never found it particular hard to reason about especially given many ORMs tend to stick to pretty vanilla SQL.
- overgard 8y agoSure you can print it out, but if your data isn’t particularly normalised (which there are good reasons not to do that), it can get gross real quick. The alternative is just manually serialising/deserialising, which is verbose of course but a lot easier to debug.
- Daishiman 8y agoThis is a tired point and in a decade of using ORMs this hasn't been the case, ever.
- jayd16 8y agoWhy do you think the comment is so common if it was never the case?
- Izkata 8y agoMissing knowledge / lack of documentation. Django for example has a couple ways to see the SQL, but the most useful one (generating it from a specific QuerySet) I can't find in the documentation - I only know about it from an answer on StackOverflow.
- overgard 8y agoAs someone else mentioned, the fact that this is a tired point actually bolsters my argument; I’m not exactly the first person to run into this. Table rows and objects just aren’t the same thing and you get really leaky abstractions treating them as such.