News for hackers. Stuff that matters.
Re:I hate queries by kemayo on Saturday September 25, 2010 @04:12PM (#1727688)
ORMs do that, mostly. Look at Active Record: http://en.wikipedia.org/wiki/Active_record_pattern

The problem with ORMs is that relational databases are complicated, and you often do wind up having to do manual SQL writing anyway if you want well-performing queries in edge cases. But for simple cases where you have a person table and need to make Person objects in your app... it works.

In fact, Rails used this as one of its big selling points, combined with convention-over-configuration. If you stuck to the naming patterns Rails preferred, it really would Just Work without you having to tell it anything beyond the names of your classes.

Re:I hate queries by adamtj on Saturday September 25, 2010 @04:32PM (#1727746)
The problem with ORMs is that life is complicated, and data describes life, so data is complicated. And abundant. SQL queries are a relatively elegant way to encode the often complicated manner in which data answers a particular question.

<sarcasm>Gah! You know what I hate about building software? The programming. All those data structures are no fun! Lists and arrays and vectors and hash tables and trees, red-black trees, binary trees, b-trees, tries. Why can't we have a programming language that automagically stores all our information in simple variables and just gives me the answer I want?</sarcasm>

Re:I hate queries by rbranson on Saturday September 25, 2010 @08:18PM (#1728200)
You have apparently never used a well-designed ORM. A well-designed ORM isn't to create this magical, leak-proof wrapper for the database. The point is the make common use cases simple and allow the developer to incrementally use more SQL as needed, for more control.