3 ms·
Am I the only one who doesn't see this as a binary choice? I've written SQL for decades and I still like ORMs for most scenarios because: 1. I always check the
by noisy_boy 5y ago
Am I the only one who doesn't see this as a binary choice? I've written SQL for decades and I still like ORMs for most scenarios because:
1. I always check the SQL being generated
2. I profile the SQL being generated to ensure that the indices are being used optimally
3. I only fetch what I need and try to reduce trips to database
4. Most of the time, this is good enough and helps reduce boilerplate.
5. Sometimes, after doing the above, I see that the ORM isn't upto the task - then I just drop to SQL and get exactly what I want the way I want it. The ORM doesn't block me from doing so.