> 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.
> 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.
Give me just enough of an ORM/abstraction to give me type-safety, leave the rest at the door.