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

> A sensible approach blends use of an ORM with handwritten SQL where needed. In fact most ORMs will allow you to do things like build collections of objects from custom SQL anyway, so there's really no need to shy away from it.

This is really where it's at. Seriously people. Nobody should be writing raw SQL.

Give me just enough of an ORM/abstraction to give me type-safety, leave the rest at the door.



> Nobody should be writing raw SQL.

What?!? That’s an absolutely foolish and naive assertion. Please don’t give any of your fellow junior devs that “advice”...


Are you advocating that I put a bunch of magic strings in my codebase? That would be a maintenance nightmare.

Unless you think I'm suggesting that no devs should ever write SQL at all in their career? Which isn't the case.


> Are you advocating that I put a bunch of magic strings in my codebase? That would be a maintenance nightmare.

Not a bunch, just the large batch queries and reports that use complicated joins. There a places where it makes sense to take the trade-off between maintainability and performance.

> Unless you think I'm suggesting that no devs should ever write SQL at all in their career? Which isn't the case.

It sure appears to be what you are suggesting. Perhaps you should clarify what you were trying to say?


> This is really where it's at. Seriously people. Nobody should be writing raw SQL.

I think nobody should be writing comments here. They should be generated by some tool. So, please, be serious.

:)




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

Search: