3 ms·
About cached values you say: "Synchronizing" them is always as simple as a single, controlled operation. Others have stated that: "There are only two hard thin
by sorokod 7y ago
About cached values you say: "Synchronizing" them is always as simple as a single, controlled operation.
Others have stated that: "There are only two hard things in Computer Science: cache invalidation and naming things"
- brundolf 7y agoYes :) This does not solve the problem of cache invalidation, it only separates it from other concerns so that it can be focused on explicitly.
- pkage 7y agoI don't think that's what he's arguing though—it's not a cache like memcached or anything, it's much more abstract than that. He's saying that calculating values derived from the program state should be as simple as possible, and not have other side effects.
- sorokod 7y agoCaching comes with a bunch of strings attached of which recalculating the values is the least problematic.
- Twisol 7y agoI think the name “cached value” is a red herring, as far as the mindset being described is considered. “Derived value” might be closer to the mark; the values are pure functions of other things, and to change the derived value you must change the things it depends on. There need not be any mention of storing that derived value in a cache and somehow invalidating it.
- white-flame 7y ago"Cached values" isn't a great name here. He should probably call them "Derived values".
- brundolf 7y agoThe word "cache" was used to encompass remote values too; i.e. ones that an external system may derive from its own state, but where that component is behind a black box.
- Yen 7y agoI've always heard it as "There are two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors"