Hacker News new | ask | show | jobs
by flukus 2881 days ago
I've always done this but I always find my cache being polluted because I didn't estimate the frequency of use correctly. Regular purges are important otherwise it ends up as a fragmented mess.

A good alternative is how I handle my clothes, many would call it a pile but my clothes are stored as a few LIFO stacks, one for work, one for weekends, one for underwear, etc. For work the shirts are all the same so it's just the simplest option, for weekends it works out well because my favorites are always at the top. I suspect most people manage their pantries the same way.

1 comments

I handle my clothes as a combination of LRU cache in each drawer for clean clothes and min heap for dirty. Ish. I agree with you that most people probably do something like this as well. It’s not rocket science, just computer science.