Remix.run Logo
bakugo 6 days ago

> it's a perfectly viable approach used by a lot of very experienced developers to build very successful applications.

"Lots of people use it" doesn't make it good. Lots of people in the past have written "successful" web applications as loose PHP files with little structure, no classes, using associative arrays everywhere (including me when I was starting out), but today it's generally agreed upon that this is not a good idea and will result in more bugs, maintenance headaches and an all around inferior developer experience, so what makes "active record" different?

I'd understand your point if it had at least some advantages over the ORM approach to make up for the clear disadvantages, but I just don't really see any beyond "it seems easier and requires writing less code" (which, as I said, primarily appeals to beginner developers who just want to get things done as fast as possible and don't understand the long-term consequences). Are there any hidden advantages I'm not aware of?

monooso 6 days ago | parent [-]

> "Lots of people use it" doesn't make it good.

I didn't say it was good (or bad), I said it's a perfectly viable approach.

> Lots of people in the past have written "successful" web applications as loose PHP files with little structure, no classes, using associative arrays everywhere (including me when I was starting out), but today it's generally agreed upon that this is not a good idea.

You're right, which is why, in 2025, no experienced developer builds web applications in this way.

Plenty of experienced developers build web applications using the active record pattern.

>Are there any hidden advantages I'm not aware of?

You mean aside from others having a different opinion about the relative pros and cons of active record, or personal preference?

bakugo 5 days ago | parent [-]

> Plenty of experienced developers build web applications using the active record pattern.

Yes, but why? Why was the "loose PHP files with no framework" pattern abandoned, but not active record, when in many ways it's a remnant of the same era with many of the same drawbacks?

> You mean aside from others having a different opinion about the relative pros and cons of active record

I'm asking what the pros are.

monooso 5 days ago | parent [-]

> Why was the "loose PHP files with no framework" pattern abandoned, but not active record..?

Presumably because people still find active record to be a productive, sane, and scalable way to build web applications, unlike a disorganised collection of files.

> I'm asking what the pros are.

Speed, terseness, simplicity, and personal preference spring to mind.

You're talking as though there is some empirical "best way", but the fact is that every language, framework, tool, and design pattern has pros and cons, and those pros and cons will change depending on the project, and the individual.

Your list of pros and cons may differ to mine, simply because of personal perspective and preference, and that's fine.

Being blunt, I would expect an experienced, senior engineer to understand this.