4 ms·
Are you telling me you don’t like to build your ORM from scratch? Kids these days..
by atarian 6y ago
Are you telling me you don’t like to build your ORM from scratch? Kids these days..
- trey-jones 6y agoI think you could replace "PHP Framework" with "ORM" in the "Always use a" section and many of the same arguments could apply. Very often (not always!) an ORM is just a crutch for a new dev that doesn't have time to learn SQL.
- lol768 6y ago> Very often (not always!) an ORM is just a crutch for a new dev that doesn't have time to learn SQL. I can definitely say that's been correct in a few cases. I'll be damned if it doesn't normally make it really easy to switch out the DBMS though (not that this portability is exclusive to an ORM!).
- trey-jones 6y agoI almost wrote some things about that. In 10 years we've never actually used this feature of ORMs, but it's good to know that some people get value from it!
- kyriakos 6y agoIn reality its very rare for any large scale application in production to have to switch to a different DBMS and in the cases when that happens, you have to worry about a lot more things than rewriting queries. Even with an ORM there is zero guarantee what you wrote for MySQL will work in Postgres or SQL Server which means. When choosing to use an ORM i think portability should be very low in the list of benefits.
- pebcakID10T 6y agoAbsolutely, the main feature any ORM needs before I will consider it, is how easy is it to write raw SQL with the ORM. Because you always have to do this on every large application, and if an ORM gets in your way, it's more hindrance than helpful. Actually love Laravel's ORM Eloquent, because it works for 99% cases, and gets out of your way and lets you populate Laravel models with raw SQL queries when you want to. After using many ORMs in many languages, it's still my favorite.