Caching
Ideally, caching is only an optimization; it doesn’t actually change the behavior of the system, except to make it go faster. Of course, that is quite often not the case, because:
- Sometimes it’s simply not possible to achieve useful benefits without having the caching change the behavior of the system.
- Sometimes programmers are just lazy.
Yesterday I spent about four hours trying to get a particular software library to work. That is one of the most aggravating and frustrating things a person can deal with; hours of making little to no progress on a problem. The issue was simply that when caching was enabled in this library, its behavior changed, and my usage was incorrect. Once I turned off caching, everything started working exactly like it was supposed to. Now, since this is an external library, I was simply trying to follow the approach outlined in the API docs. Too bad it didn’t explain the differences in usage when caching is enabled or disabled!
So I think this falls into the “lazy” category. A couple sentences in the API docs could have saved me four hours…