3 ms·
> I'm relatively seldom worried about actual side effects I'll give you one concrete example: In a number of ORMs, I have no idea when database calls actually
by Tainnor 5y ago
> I'm relatively seldom worried about actual side effects
I'll give you one concrete example: In a number of ORMs, I have no idea when database calls actually happen and this can lead to a) subtle logic bugs (inconsistent state), or b) bad performance (N+1 queries).
I've had such problems both with Ruby's Active Record and Hibernate, two of the most popular ORMs. I've even deployed code that had subtle bugs, even though I wrote tests, because while my tests verified that the correct state of the object was written to the DB, the updated state was not reflected in the JSON response object. I'm sure similar things happen in other frameworks as well.
A PFP can prevent that sort of craziness from happening.
- magicalhippo 5y agoFair point, though I'd say such ORMs are broken by design by the sound of things.
- Tainnor 5y agoI agree that Hibernate in particular is broken by design, but it is what it is...