logoalt Hacker News

hatefulhearttoday at 4:03 PM5 repliesview on HN

I have seen many ORM enjoyers argue the point about “you can just use SQL!” but I have never once seen an ORM enjoyer allow it, much less do it themselves in an actual codebase. They will time and time again prefer you write 100 lines of Typescript/Python for what could be achieved with 15 lines of SQL.


Replies

jghntoday at 4:15 PM

To make matters worse, most of the time I've successfully argued a project to just use SQL instead of an ORM, what has happened is that people over time built a home rolled ORM in the development language.

It's like people can't just let go.

show 1 reply
zadikiantoday at 4:35 PM

And then the 100 lines of JS/Py ends up being way slower than the manual SQL, plus the autogen'd SQL part of it is slow, plus you can't even get the SQL query to profile without running the actual thing with prints.

show 1 reply
pjmlptoday at 4:19 PM

Worse, that code will be executed on the receiving end, and waste a bunch of network traffic.

nfw2today at 4:15 PM

The reason given to use raw SQL is for the performance not the perceived code clarity.

show 2 replies
7bittoday at 4:46 PM

Great anecdote. Doesn't validate your claim

show 1 reply