Hacker News new | past | comments | ask | show | jobs | submit login

An opportunity to engage in a useful discussion derailed by ad hominem and conflating things.

SQL and the relational model (two different things) predate OOP and the need for ORMs (object-relational mappers) by one to two decades. It was the widespread adoption of Java — everything an object — in the mid-1990s that led to ORMs, at a time when various commercial “relational” databases already dominated data management. Microsoft’s Active Record and then Ruby/Rails, among others, perpetuated the use of ORMs. Most programmers who entered the field after 2000 learned ORMs and their associated query builders before learning SQL or relational database concepts, if they ever learned those things at all.

ORMs can make some things simpler, including composing queries, but as you noted that means SQL can do the same thing. Some more recent additions to SQL, such as CTEs, and features such as named views and subqueries that ORMs discourage, make SQL more composable. If we could write in predicate calculus we wouldn’t have to deal with SQL’s shortcomings, but that battle got lost in the 1970s and now we have decades and billions of lines of SQL (most of it not generated by ORMs) that won’t go away.

Going back to my original point, way up this thread… PHP and Go, specifically, do not need add-in ORMs because the languages have built in support for mapping query results to native objects/structs. If someone uses a query builder with those languages most likely they do so out of habit, or because they can’t or don’t want to write SQL. But PHP and Go do not need an ORM or query builder, just like they don’t need add-on HTML templating.




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

Search: