Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

while ORMs can do quite a bit of optimization, they're still general query builders and can't construct the optimal queries for your use case. if you don't know SQL, or you don't know what's going on behind the scenes, your ORM could be performing much larger queries than it really needs to, costing performance and time


Most ORMs have way too write raw SQL. Furthermore someone using an ORM well will understand how their queries are mapping to SQL.

Your scenario happens with people that either don't know or don't care. They will write crappy queries with any tool.


Sounds about right.

I built a moderately complex application in Django at a previous workplace, using the ORM for most things, until the queries were too complex for the ORM.

Another guy connected to the same database and built some graphs using PHP and SQL. Guess who had to help him write the SQL when the queries got too complex for him? The ORM user.


But that's a completely orthogonal problem — the point made (way) above is that you need to understand SQL whether or not you use an ORM.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: