Re:Ask HN: What are good patterns for holding state?
by tracer4201 on Saturday December 09, 2023 @01:21AM
(#38579174)
What problem are we trying to solve?
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.