Computing IRL
My computer science patter is full of tree, buffer, bucket, root, overflow, spill, and pipeline but what happens when computer scientists try to implement the principles of computer science in their daily lives?
In caricature, the answer is to solve every problem with a computer but my former colleague (and mathematician turned computer scientist) David offered something closer to what I mean. When I asked him for advice about whether I should rent something or buy it, he offered a process he called “The Computer Science Algorithm”. Rent it or subscribe to it or stream it until you have spent the purchase price. The next time you use it, buy it. Easy and within a factor two of optimal. I have now been using and adapting this for more than 20 years.
David’s tip is nominally about acquisition but it probably applies to a lot of domestic allocation problems as well. In some ways, rental is like automatic storage management. To keep, I should use an algorithm for storage management. My robotic Roomba could tell you that I’m not great at mark and sweep garbage collection. Maybe I should arrange my bookshelves for a generational strategy. Reference counting is right out.
Other algorithms flooded into mind last week when the century-old sewer pipe under my house decided that the tree in the yard had obtained root and that root meant a buffer overflow. Oh yes, there would be buckets.
What does computer science demand in this case? It demands first a suspension of common sense. The pathological case becomes the worst possible case, not merely a case which would qualify as a disease. Thankfully, my house didn’t fill to the rafters with sewage before it was time for a diagnosis. In how many other cases do we ignore frank disease in computing because it’s not maximally bad.
With that, what comes next? It may be that my boiler control loops are Turing complete, but it’s hard for me to apply this to daily life. Can I apply the all-purpose Computer Science Algorithm in this case? Interesting. I could rent another apartment for my family for several months for the full cost of excavating through a basement floor, replacing thirty feet of cast iron pipe feet below that, and putting it all back together. Is this what I should do? No. The time for rent-before-buy was twenty-odd years earlier. Perhaps it’s linear speedup theorem. I need to accept that the speed of the job corresponds with the amount of mess and mayhem and that garbage collection afterwards is a better bet than a slow but tidy job. That appeals to the Scheme programmer in me.
Perhaps it’s Amdahl’s law. When shopping for a replacement floor, the maximum ‘speedup’ from even free material is modest when labor dominates. Gordon Bell, famous architect of still more famous PDP minicomputers from DEC, had a principle of system design that I recall from a consulting job we did together. The system cost should be a third compute, a third memory, and a third storage. Maybe compute is labor, tile is storage, and the swapping and staging of material and emptying of cabinets should be the final third. In that case, it would have made sense to rent space temporarily for the contents of my basement rather than use cumbersome data compression algorithms to relocate everything elsewhere in the house. That sounds right in retrospect.
The biggest takeaway so far was about buckets and buffer pressure. The correct volume of a bathroom wastebasket is about twice the capacity of the toilet tank.