Daniel Wigton on Nostr: I am interested in hearing the argument. An ORM can certainly reduce boilerplate and ...
I am interested in hearing the argument. An ORM can certainly reduce boilerplate and protect against common security issues. Database migrations are useful as well.
I am, however, unconvinced that they are a net benefit. Some developers use them as a way to avoid having to write SQL, but SQL is dead simple and I have never met an ORM that was actually good at it. It generally means that the developer doesn't really understand what they are getting with their queries.
Also while an ORM might make 90% of your queries easier that last 10% might be downright impossible. Luckily you can just make stored procedures and more models in your code to match, but now a decent portion of your application logic is in your database and you have a mess in your code.
I am, however, unconvinced that they are a net benefit. Some developers use them as a way to avoid having to write SQL, but SQL is dead simple and I have never met an ORM that was actually good at it. It generally means that the developer doesn't really understand what they are getting with their queries.
Also while an ORM might make 90% of your queries easier that last 10% might be downright impossible. Luckily you can just make stored procedures and more models in your code to match, but now a decent portion of your application logic is in your database and you have a mess in your code.