• 0 Posts
  • 2 Comments
Joined 1 year ago
cake
Cake day: July 2nd, 2023

help-circle
  • You’re right, I can learn the basics of regex in 30 minutes. Then I can write my one regex. Then I can forget the basics of regex in 3 minutes, because regex’s syntax is random garbage that makes no intuitive sense, and I hate and suck at memorizing nonsense. Repeat every 4-16 months.

    It’s true though that regex is entrenched enough that even if something is easier to read, it’s unlikely that it’ll replace regex any time soon. You’d need a couple big names to adopt it, then many years.

    But if there’s a readable replacement that can convert to and from regex - well, screw it, I’m in. Even if I’m required to use regex in some program, if I can write something that makes sense without the requisite half hour of googling crap, I’ll just use it as a separate tool to make and read regex strings.


  • This assumes you’re looking for a particular item of clothing. It’s true that the clothes cache is not optimized for that.

    However, if you are instead looking for a shirt, a pair of pants, and/or so on, without regards to which specific shirt, and if the cache is randomly sorted and the distribution of all such items is roughly equal, then it becomes O(1) - regardless of the size of the cache, you’ll get what you want within 4 or 5 checks. Plus, you typically want one of each of the types of item, and you’ll get all of them within those same 4 or 5 checks.

    Bonus: the checks can be parallelized by using a “wide” cache that enables multiple items to be checked at once. This is why I use a short and wide clean clothes basket and a tall and skinny dirty clothes basket.