4 ms·
Lots of mundane human activities are most naturally represented as while (or do-while) loops. For example, wiping one's butt: do { wipe() } while { c
by aragonite 3y ago
Lots of mundane human activities are most naturally represented as while (or do-while) loops.
For example, wiping one's butt:
do {
wipe()
} while { color_of_tp() !== "white" }
Or anything that falls under cleaning, really.
Although I'd argue while loops belong most at home in imperative code. (Cleaning for example is like the impure function par excellence, done only for side effect)
- ape4 3y agoI think this code would be nicer if the wipe() function returned the color ;)
- deleted 3y ago[deleted]
- dmichulke 3y agoYou should not use "white" but the initial color_of_tp()
- Vvector 3y agoAnd brown TP causes your program to be stuck in endless loop
- misja111 3y agoI would definitely stop wiping if the color turned to red.
- culi 3y agoi recommend witch hazel
- pixel8account 3y agoIronically this one may actually be better represented by a for loop, because after 20 times or so you might want to reconsider your situation.
- tzs 3y agoNote that on the last time through the loop you are doing a wipe() that was not actually necessary to accomplish your cleaning goal, and thus wasting some paper (unless you note that it came out white and set it aside to use on the first iteration the next time you need to clean, but I doubt anyone does that). Some people were once trying to come up with the most useless possible superhero or supervillain, and I suggested "Exact Wipe Man", with the power to look at the result of a wipe of anything and know if that was the last wipe needed. While on the subject of wiping one's derrière, I once read a question in an advice column where the questioner said that for some reason that subject came up among a group of people and someone asked what direction people wipe. It turned out that in that group of around 10 people 9 went one way and one went the other. That one wrote to ask if he was a freak or if he was normal and surrounded by freaks. The columnist of course had no idea what the answer was, and asked around the office. She found that nearly everyone in the office went the same way as the questioner's friends, and informed him that he did appear to be unusual. It turns out that I am also in the minority group. It had never even occurred to me that anyone might go the other way as it seems completely unnatural to me. Most people wipe in private with not even people they are in intimate physical relationships with watching and it is almost never a topic of discussion so you can be doing it completely different from everyone else and never find out. This raises the question of what other things do we regularly do in private but might be doing in some way different from most other people? Maybe I'm flossing or brushing my teeth in some weird way, or maybe the way I turn on under the shower head always misses one particular spot and so I've got some section in the middle of my back that's never washed, or something like that? I was tempted to subscribe to a month or two of one of those "voyeur" sites where they have a house with cameras in every room so you can see everything the residents do, to see how my flossing, showering, etc., compared, but never got around to doing so.
- jaktet 3y agoWell what direction was the unusual way?
- nh23423fefe 3y agothe correct way is obviously away from genitals not towards.
- deleted 3y ago[deleted]