It's all about people, not the ORMs or other technical inventions.
Most shithead queries I encountered during years of DBAing were written by hand by poor folks abandoned by their colleagues and over-confident managers.
Just no one cared to educate them, but everyone expected "progress" from them. So they did what they could..
In fact I wished many times that they used some abstraction layer which would save them from doing such harm, simply because this layer would be written by more educated people.
Most shithead queries I encountered during years of DBAing were written by hand by poor folks abandoned by their colleagues and over-confident managers.
Just no one cared to educate them, but everyone expected "progress" from them. So they did what they could..
In fact I wished many times that they used some abstraction layer which would save them from doing such harm, simply because this layer would be written by more educated people.