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

Someone seems to write one of these every few years about whatever the flavor of the month is. I recall reading one from sometime in the early 2000s about Hibernate that read the same way. And another one for one of the Perl ORMs before that.

Yet somehow, dirty, ugly, hard-to-write SQL is still here while ORMs keep coming and going. And I have yet to see one without an escape hatch allowing raw SQL.



>"And I have yet to see one without an escape hatch allowing raw SQL."

I don't know where you've been looking, but from what I've seen it's an easy to find feature. To give two examples:

https://docs.djangoproject.com/en/1.10/topics/db/sql/

https://github.com/StackExchange/Dapper


Unless my reading ability is broken, we seem to be agreeing. I said I have never seen one that doesn't have one.

My point being that ORMs can't fully replace SQL, and the proof is they all provide an escape hatch.


They provide an escape hatch because the language has support for features such as temporary tables, native DB functions and transaction control that are nonstandard and have a hundred gotchas, and are therefore not amenable to implement in an ORM.

I have 30k lines of business logic written for Django that does not use that hatch even once.


Again, I see point of disagreement, other than an odd bit of defensiveness about ORMs.




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

Search: