Now that Twitter is on a downward spiral I'm rewriting my favorite tweetstorms in a more permanent medium, so here's the first: why do we have the ter

Why do we call it "boilerplate code?"

submited by
Style Pass
2024-12-01 00:30:07

Now that Twitter is on a downward spiral I'm rewriting my favorite tweetstorms in a more permanent medium, so here's the first: why do we have the term "boilerplate code"? It comes from the peculiar interplay of two industrial revolution technologies: steam engines and hot metal typesetting.

So let's start with the steam engine. Steam engines run on steam, produced by a water boiler. The hotter you can get the steam, the more efficiently you can extract energy from it. Now according to the ideal gas law, if you increase the temperature of a gas while holding the volume constant, you'll also increase the pressure. If the boiler can't handle the pressure, it explodes. This is a bad thing.

A lot goes into boiler engineering, but the relevant thing here is that boilers need to be uniformly cylindrical. If the boiler has sharp angles, or if the boiler wall is thinner in one place, then Bad Thing is more likely. Fortunately, there was a well-established method of producing large, flat sheets of metal with uniform thickness: rolling. Boilermakers started buying vast quantities of cast iron from rolling mills, so large rolled sheets came to be called "boiler plate".

Now for the Linotype. Up until the late 19th century, all printing presses were typeset manually. To print a letter, the printer would select a corresponding metal slug and manually place it in the press. Once you had a full set you could print a lot of very high quality papers, which ameliorated the cost of all that manual labor. But for text that changes rapidly— like daily news— the manual overhead is too high.

Leave a Comment