▲ | 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? | |||||||||||||||||
|