9 ms·
well played. I think that just got added to my standard vocabulary. Caching has caused more errors and bugs that I've had to deal with than I can recall. My fav
by sethammons 6y ago
well played. I think that just got added to my standard vocabulary. Caching has caused more errors and bugs that I've had to deal with than I can recall. My favorite was an off by one error where we returned nicely cached info -- just for the previous user who came through our system! :facepalm: That was a bad one.
- taf2 6y agoYeah but the speed.
- saganus 6y agoHere goes the obligatory > There are only two hard things in Computer Science...
- jholman 6y agoI can never remember what they are, though. To avoid this problem, I think I wrote them down on a post-it, but I had too many post-its on my desk so I got rid of them all, and now I can't remember.
- joubert 6y ago> wrote them down on a post-it You write it on local media and kept it on-premises? Cloud is the new thing, I hear.
- ampdepolymerase 6y agoThe Post-it was but a cache.
- mrathys 6y agoI would consider the Post-it as persistent storage or the backup. Your memory would be the cache :D
- llarsson 6y agoThe two most difficult ones are naming things, cache invalidation, and off-by-one errors. HTH. ;)
- samb1729 6y agoWhat does HTH mean?
- sgn 6y agoHope That Help, HTH.
- kzrdude 6y ago"Hope this helps" I see it with HAND "have a nice day" too
- _puk 6y agoI've always read it as "Happy To Help". I see that's wrong, but ignorance has made the internet seem just that little bit warmer all these years!
- gwd 6y agoI think it could probably mean "Happy to help" if said in response to a thanks of some sort. Saying it before someone has said thanks is a bit presumptuous. :-)
- mattacular 6y ago"Hope this helps" (sometimes used sarcastically)
- zaphirplane 6y agoThey are likely making a joke about caching the answer
- Xelbair 6y ago
- bryanrasmussen 6y agothis reminds me I was dumpster diving at a place with lots of post-it notes and there was one that said 2HCS => whatchamacallit, CI! what that you? on edit: I'm going to let that 'what that you' stand because one of the hardest things about HN posts is grammatical correctitude.
- deleted 6y ago[deleted]
- anyfoo 6y agoThat's because essentially, "state" and "caching" are the same thing on some level. And the problem with state is that you have to make sure all your state transitions don't cause bugs. What we know as a "cache" is essentially creating new state representing existing state, with all new transitions...
- bin_bash 6y agoCache is a type of state but not necessarily the other way around
- anyfoo 6y agoIn the efficient implementation of a pure functional language (say Haskell without MVars), what really is the difference between state and cache? I know this is overly philosophical, and in practical scenarios we readily (although not always unambiguously) differentiate between "cache" and "state", but the point about transitions and that being a major source of bugs still stands.
- eru 6y ago> In the efficient implementation of a pure functional language (say Haskell without MVars), what really is the difference between state and cache? If you want to unify state and cache, you might want to go down a different route: Think of log based filesystems (or a log based data base). Instead of defining your operations in terms of state, you define them as pure functions of the log. So your log is full of operations. Writing just means appending a symbolic operation like `write(key, value)` to your log. And you define the result of `read(key)`: scan backwards through the log until you hit the last instance of `write(x, value)` and the return that `value`. Now state means: compact your log by replacing a swath of `write` log entries with one big `snapshot` operation that encompasses many key/value pairs. Alternatively, you can also define state to mean caching your `read` operations. In this approach, it's no coincidence that the log is a data structure that has a linear shape: the evolution of state over time is also linear. (With some cleverness you can replace the linear structure with eg a DAG; and then also think about how you merge divergent states.)