←back to thread

873 points belter | 1 comments | | HN request time: 0s | source
Show context
imjonse ◴[] No.42947407[source]
> ORMs are the devil in all languages and all implementations. Just write the damn SQL

It depends on what you're writing. I've seen enough projects writing raw SQL because of aversion to ORMs being bogged down in reinventing a lot of what ORMs offer. Like with other choices it is too often a premature optimization (for perf or DX) and a sign of prioritizing a sense of craftsmanship at the expense of the deliverables and the sanity of other team members.

replies(8): >>42947752 #>>42947978 #>>42948317 #>>42948504 #>>42953164 #>>42954817 #>>42956074 #>>42956308 #
torginus ◴[] No.42956308[source]
I'm a hardliner on supporting this - I'd go further - all the DB code should be in SQL, with the database being manipulated by stored procedures and the db schema not even being exposed to the common developer.

As far as I know this is a very oldschool view on how to treat dbs, but I still think this is the only correct one.

I hate ORMs with a passion - they're just a potential source of bugs and performance issues, coming from either bugs in the engine, devs not understanding SQL, devs misjudging what query will get generated, leaky abstractions etc.

It's big enough of an ask to understand SQL itself, it's the height of folly to think you can understand SQL when it's being generated by some Rube-Goldberg SQL generator, especially if said generator advertises that you don't need to know SQL to use it.

replies(1): >>42962885 #
1. jugg1es ◴[] No.42962885[source]
You must live a charmed life if you haven't run into major problems with stored procedures.