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

I won't argue why they exist but I would argue that they help with security, database design, or proper techniques.

Security - You don't need an ORM to prevent SQL injections. Plenty of libraries handle safe string SQL formatting.

Database design - I feel depending on an ORM for this instead of actually thinking about the solution would lead to just as many mistakes.

Proper Techniques - It is proper until it isn't I guess. Trying to get the ORM to do things it doesn't support usually leads to unexpected side effects.



You don't need an ORM, it just helps immensely.

Here's a recent error I found, and of course, this is a PHP issue, someone used if(empty()) and the value was a string "0" . This evaluated to true, causing a function, that builds up inserts from an associative array (functionally equivelant to say, eloquent's Model::create($data)->save()), to insert NULL instead of "0".

Now, we can say that's a php ism, that's just a bug or mistake, but I have found repeated issues like this, especially with legacy PHP code.

Going out the gate with something like Eloquent in Laravel, and showing people patterns, really does help. It helps isolate their mistakes, it gives them rails to ride on.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: