Only God Writes Perfect Code


Sometime in early high school, I went to some sort of science-y summer camp for gifted & talented students. The class I took was "Supercomputing Applications." Basically the class revolved around building wireframe models and animating them in some Mac program named Renderman and then submitting it to a faraway Cray supercomputer at Livermore which had dedicated some cycles to rendering these (320x240!) into ray-traced animations.* We just spent the whole summer doing that; it was pretty fun.

The teacher of this class was from some high school or something, and he had a thing for QUALITY. He believed in doing a good job, in always doing 100%, and he constantly encouraged us to strive for perfection. It wasn't that he'd point out flaws in your wireframe model, but I think whenever someone did a shoddy job, he'd encourage them to really polish things. He was a little over-the-top about it, but not annoyingly so. I did well in the class because I really paid attention to details.

One of the class highlights was a trip to Cray Research (the company Seymour Cray left) in Chippewa Falls, Wisconsin. We got to see the production facilities for the Crays, we got to see a little mini-museum of old memory cores and coolant, and they told us about how Cray Research would build you a computer in whatever colors you wanted, because you were paying so much for it, so why not? Oh, and they included a bench to sit on.

At one point, we talked to one of the lab guys there who worked directly constructing the supercomputers, and he showed us some pretty amazing things like how much crazy wiring and memory went into the computers and such. My teacher said enthusiastically, "...and you guys always do a 100% job, right?" to which the guy replied quite blandly, "No, nothing is 100%. That's impossible. You decide how much of an error margin you want to tolerate, and you pay for that. Getting a smaller and smaller error margin is more and more expensive. Nothing can be 100%."

Obviously, my teacher was pretty taken aback, and he tried not to show it in front of the students, but what that lab guy (I suppose he was a real computer scientist, as I would one day be) stuck with me right then. You don't get perfection, ever. You just decide how good you want something to be, and then you see if you can pay for it.

Many years later at PayPal, a friend of mine remarked that code was like Persian rugs. If you don't know, the people who make Persian rugs deliberately never make a perfect rug - they always make sure include a tiny flaw, because only God makes perfect things.

* Hilariously, I can now perform the same function on my phone.

Originally posted here on 2008 Sep 18, by Yishan Wong.