I buy more $CONSUMABLE whenever I take the last unit of $CONSUMABLE out of storage. If I don’t order online or add it to the grocery list right away, I put the old empty (second-to last) container in a place where it is likely to prompt me to resupply in a timely manner, which is often different from the place where $CONSUMABLE is consumed. Otherwise there’s the risk that the “special sentinel” is always encountered at a place or time where resupplying is inconvenient, and so it might run empty before you get around to it, despite its “special” nature. This approach also has the benefit that you don’t have to switch from your favorite variety of $CONSUMABLE.
Toothpaste Null-Terminator
31–40 of 81 posts
Re: Toothpaste Null-Terminator
#32Am I the only one that has no trouble buying toothpaste when I have to squeeze the tube extra hard?
Many years ago I learned from some Japanese TV show that you can use centrifugal force to get the very last bit of toothpaste out of the tube even if you can’t squeeze out any more. Something similar to this: https://m.youtube.com/watch?v=u-4MKefJqbc
Re: Toothpaste Null-Terminator
#33I use an even simpler and more reliable system to avoid running out of toothpaste: brushing with plain water. Evidence suggests that brushing with toothpaste (called "dentifrice" in scientific papers) does not remove any more plaque than brushing without it. Here's a systematic review from 2016: >Does dentifrice use help to remove plaque? A systematic review https://pubmed.ncbi.nlm.nih.gov/27513809/ "The cumulative e…
So do you change your toothbrush every quarter?
Re: Toothpaste Null-Terminator
#34I use an even simpler and more reliable system to avoid running out of toothpaste: brushing with plain water. Evidence suggests that brushing with toothpaste (called "dentifrice" in scientific papers) does not remove any more plaque than brushing without it. Here's a systematic review from 2016: >Does dentifrice use help to remove plaque? A systematic review https://pubmed.ncbi.nlm.nih.gov/27513809/ "The cumulative e…
Re: Toothpaste Null-Terminator
#35I use an even simpler and more reliable system to avoid running out of toothpaste: brushing with plain water. Evidence suggests that brushing with toothpaste (called "dentifrice" in scientific papers) does not remove any more plaque than brushing without it. Here's a systematic review from 2016: >Does dentifrice use help to remove plaque? A systematic review https://pubmed.ncbi.nlm.nih.gov/27513809/ "The cumulative e…
Wow! Thanks for sharing. So do you change your toothbrush every quarter?
Re: Toothpaste Null-Terminator
#36Hahaha, why not just check if the toothpaste you're grabbing is the last one?
Still I think this is a stretched analogy. Decent strategy in real life, but programming is not the same and in my experience in-band signalling like this generally leads to fragile code. I mean nobody would recommend null terminated strings as a sane design today...
Re: Toothpaste Null-Terminator
#37> When I find that the only tube of toothpaste left is that special, sentinel toothpaste, then I know it is time to buy more toothpaste. I buy more $CONSUMABLE whenever I take the last unit of $CONSUMABLE out of storage. If I don’t order online or add it to the grocery list right away, I put the old empty (second-to last) container in a place where it is likely to prompt me to resupply in a timely manner, which is of…
I put anything needing resupply, empty or approaching empty depending on the item, right there on that part of my desk. Unless I’m rushed or preoccupied, checking that space before I leave for the store is usually pretty effective for my defective executive function.
Remembering to clean up the queue afterward is a bit more challenging. But that’s just a mild inconvenience compared to prior years of consistently failing to stock essential items on a routine basis.
Re: Toothpaste Null-Terminator
#38I might suggest phrasing this a little differently. Obviously, when you find that any tube is the only tube left, you know it’s time to buy more toothpaste. The problem is that you realize this early in the morning or right before bed, and so you’re likely to forget. The advantage of the “sentinel toothpaste” is that it continues to remind you after that moment, so that you’ll actually remember when you have time to do something about it.
And I think that captures the key thing about a sentinel value: it captures state in a place where you’re already storing state, without requiring you to wrap the state in some external structure, e.g. putting a sticky note on your mirror or storing a string’s length in a separate field.
Re: Toothpaste Null-Terminator
#39Buy two tubes, while true, when you finish a tube, add one toothpaste tube to the shopping list, done. Works great for an average person who usually visits the store. Adjust the initial putchase if you visit the store twice a year. Also works great for many suplies like coffee, pasta, legumes...
Re: Toothpaste Null-Terminator
#40I use an even simpler and more reliable system to avoid running out of toothpaste: brushing with plain water. Evidence suggests that brushing with toothpaste (called "dentifrice" in scientific papers) does not remove any more plaque than brushing without it. Here's a systematic review from 2016: >Does dentifrice use help to remove plaque? A systematic review https://pubmed.ncbi.nlm.nih.gov/27513809/ "The cumulative e…