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

> Most ORMs advertise “type safety” and not having to learn SQL. But actually you’re just writing SQL code in a non-SQL language.

That's...not writing SQL code, just as advertised. In the same way that writing code in a higher-level language isn't writing native machine code.



The difference is you’re still writing SQL keywords, just as functions

e.g. userPosts = Posts.InnerJoin(Users).SelectAll().Where(user => user.id == userID)

It’s not always exactly the same, but the point remains that you have to understand SQL anyways and the code usually isn’t any clearer.

Maybe i’m confusing this with query builders. ORMs also let you form queries by interacting with objects directly, e.g. ‘user = Users.Find(userID); userPosts = user.Posts’. But that leads to the other issue with inefficient and unpredictable queries.




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

Search: