Lately, I find myself agreeing with everything in this reddit post regarding ORMs. I should be able to look at a method or function, and easily be able to determine if it will generate a single query or N+1 queries. I don’t want to have to learn how to get an ORM to generate SQL when I could just use SQL. Even the benefits I do like about ORMs, such as being able to compose conditionals, limits, and offsets are not intrinsic to ORMs.

When Rails came out, everything about it, including ActiveRecord, was a breath of fresh air compared to the alternatives at the time. Even sanitizing queries was a bit of a chore. We have more choices now, and I definitely prefer a more functional style. I find web backends, in particular, perfectly suited for this. A request is basically a function that takes the cookie, URL, headers, etc. and transforms that data into a response. This functional approach pairs quite nicely with writing SQL and getting pure data back without the complexities of objects and ORMs.

Aside 1: There have been attempts to make the backend more stateful, like Drupal’s form_state, but luckily, none of those caught on.

Aside 2: I tried to do something similar back in my PHP days but operating on PHP arrays was really slow.