When I think of holding in memory state, to me it’s less about class or OOP vs something else and more about race conditions, thread safety, possibly idempotency, and proper abstraction design.
Abstraction design meaning, I’m not exposing the keys to the castle or leaking internal details where it might allow another good intentioned programmer to do bad things or introduce some subtle, difficult to reproduce bug.
When I think of holding in memory state, to me it’s less about class or OOP vs something else and more about race conditions, thread safety, possibly idempotency, and proper abstraction design.
Abstraction design meaning, I’m not exposing the keys to the castle or leaking internal details where it might allow another good intentioned programmer to do bad things or introduce some subtle, difficult to reproduce bug.