11 ms·
Why do we call it “boilerplate code?”
- Eumenes 4y agoI read a book on the American Civil War and the term 'boilerplate' was used often to describe how the Confederate Navy would reinforce barges and steamboats with boilerplate to convert them into military vessels. It was also used to construct an early submarine: https://www.history.navy.mil/research/underwater-archaeology/sites-and-projects/ship-wrecksites/hl-hunley.html https://www.history.navy.mil/research/underwater-archaeology...
- js8 4y ago..and later, armies of lawyers were reinforcing their contracts with boilerplate.
- millzlane 4y agoAhhh one of those Iron-Clad Contracts.
- simonh 4y agoBut in that case they were literally using actual boiler plate, it wasn't a euphemism, as in the linked article the submarine was constructed out of boiler plate.
- bell-cot 4y agoWhy: Making any sort of thick, strong plate metal is seriously non-trivial, both in terms of the manufacturing facility required, and the metallurgical expertise to actually do it. The CSA had very little heavy industry compared to the Union. Boiler plate (widely used, in a steam-powered world) would be about the only armor-ish product that the CSA could manufacture for itself. (Similar for hull plates for a submarine - though boiler plate is far closer to the ideal material there.)
- Eumenes 4y agoNow I'm curious how boiler plate is made. Can't find much - its all code stuff per google search. Seems like its just hot rolled steel plate to a certain thickness.
- bell-cot 4y agoIANAM (...Not A Metallurgist), but this looks plausible...(if extremely simplified): https://steelplates.in/how-to-manufacture-steel-plates-sheets/ https://steelplates.in/how-to-manufacture-steel-plates-sheet... From vague memory, the two huge issues for armor plate (especially ~150 years ago) are: - Having the extremely heavy equipment needed to roll very thick plates. ~Nothing except warship armor was anything resembling that thick, for such equipment to even have been developed previously. - The specialized metallurgy & treatments needed to make "hard" armor. Iron/steel plate for other purposes (boilers, etc.) was optimized for physical properties which bore very little resemblance to "resistant to penetration by high velocity cannon balls".
- hprotagonist 4y agoRelatedly, see the etymology for "stereotype" and "cliche": https://www.etymonline.com/word/stereotype https://www.etymonline.com/word/stereotype 1798, "method of printing from a plate," from French stéréotype (adj.) "printed by means of a solid plate of type," from Greek stereos "solid" (see stereo-) + French type "type" (see type (n.)). Meaning "a stereotype plate" is from 1817. Meaning "image perpetuated without change" is first recorded 1850, from the verb in this sense. https://www.etymonline.com/word/cliche https://www.etymonline.com/word/cliche 1825, "electrotype, stereotype," from French cliché, a technical word in printer's jargon for "stereotype block," noun use of past participle of clicher "to click" (18c.), supposedly echoic of the sound of a mold striking metal (compare native click).
- nordsieck 4y agoI think the explanation of stereotype needs a bit of explanation to make sense. In early printing, a plate would be assembled from individual letters of type before it was used for printing. However, it quickly became apparent that certain words or phrases were used a lot, so typesetters would create "a solid plate of type" for those words or phrases to speed up the typesetting process.
- kragen 4y agono, this is talking about a solid page-sized plate of type, not phrase-sized plate of type before the stereotype process, you printed from the individual letters of type, as people still do today for flyers https://en.wikipedia.org/wiki/Stereotype_%28printing%29 https://en.wikipedia.org/wiki/Stereotype_%28printing%29 https://en.wikipedia.org/wiki/Letterpress_printing https://en.wikipedia.org/wiki/Letterpress_printing
- alricb 4y agoNah, I think it refers to the fact that popular printing items, like the Bible or popular books that stayed in print more or less indefinitely would be stereotyped, that is an imprint of the pages would be taken, then a used as a mold to cast a plate that could be used while the type slugs could be re-used for something else. A large part of the printing business was to print fill-in-the-blank business stationary, like orders, invoices, etc. So a stereotype came to mean a standard form that you could adapt to whatever context by just changing a few details.
- ecolonsmak 4y agoIn the 19th century, a boilerplate referred to a plate of steel used as a template in the construction of steam boilers. These standardized metal plates reminded editors of the often trite and unoriginal work that ad writers and others sometimes submitted for publication.
- Zigurd 4y agoWithout further research, my impression of where that term originated was in drafting contracts: The parts, like confidentiality, that are standardized and a component of most contracts, are the "boilerplate," in contrast with the parts, like a statement of work, that are specific to a particular contract. Did it jump from writing, in general, to legal contract drafting?
- larrik 4y agoI think "boilerplate code" came from the legal term, but the article dives deeper to figure out where the legal system got it in the first place.
- asmithmd1 4y agoBeing a mechanical engineer by training, I always assumed it had come from the requirement that all boilers must have a nameplate affixed with a bunch of not really useful information about how it was tested. The hot water heater in your house has a boiler nameplate, and nuclear power plants have a "nameplate" rated capacity: https://www.nei.org/resources/statistics/us-nuclear-plant-owners-and-operators https://www.nei.org/resources/statistics/us-nuclear-plant-ow...
- nickpinkston 4y agoYea, I think this is actually the real answer, and OP is just wrong. Here are old and modern examples where the boilerplate is a standardized plate that's filled out using punched letters/numbers. https://lestaret.files.wordpress.com/2009/09/boiler-3a.jpg https://lestaret.files.wordpress.com/2009/09/boiler-3a.jpg https://www.steephillequipment.com/wp-content/uploads/2017/06/IMG_5008.jpg https://www.steephillequipment.com/wp-content/uploads/2017/0... (am also in the MechE space)
- ergonaught 4y agoAssumptions are immaterial, however. Etymology of the term is as noted in the article. It is more likely that this use (as on water heaters and such) derives from the same typesetting usage.
- ynniv 4y agoIt's always satisfying to be certain, but the meaning of words does shift over time, and sometimes words have multiple origins. Assuming that 70s or 80s programmers knew anything about printing presses is tenuous. Given the long assumption that boilerplate refers to plates on equipment and superior fit of "fill in the blank" documents, it seems more likely that this is the intended meaning. Perhaps the term was heard and misunderstood early on? But the proposed origin doesn't align with the community that's using it to refer to source code.
- pavon 4y ago
- 6gvONxR4sf7o 4y ago> The author says that because of boilerplate, “brains have been at a discount” and “the editorial needs have chiefly been a strong right arm and an axe” It’s remarkable to see a sentiment that’s so common in the internet era showing up in 1894. Today, you’d probably phrase it as ‘we’re in an attention economy due to boilerplate’ or ‘the signal to noise ratio is worse due to boilerplate’ or something (with modern ‘boilerplate’ being electronic rather than mechanical).
- marcosdumay 4y ago> It’s remarkable to see a sentiment that’s so common in the internet era showing up in 1894. There is a famous ancient Greek quote, that AFAIK nobody can agree on the author with basically the same sentiment. The written word surely destroyed our civilization.
- HPsquared 4y agoSocrates on writing (verbally, as Socrates famously didn't write anything himself): "For this invention will produce forgetfulness in the minds of those who learn to use it, because they will not practice their memory. Their trust in writing, produced by external characters which are no part of themselves, will discourage the use of their own memory within them. You have invented an elixir not of memory, but of reminding; and you offer your pupils the appearance of wisdom, not true wisdom, for they will read many things without instruction and will therefore seem to know many things, when they are for the most part ignorant and hard to get along with, since they are not wise, but only appear wise." It's a lot like what people say now about the internet, Google etc.
- idontpost 4y ago
- dredmorbius 4y agoThe passage appears in the Phaedrus, and has Socrates quoting an earlier Egyptian, Thamus: SOCRATES: … Among the ancient gods of Naucratis in Egypt there was one to whom the bird called the ibis is sacred. .... The story goes that Thamus said much to Theuth, both for and against each art, which it would take too long to repeat. But when they came to writing, Theuth said: “O King, here is something that, once learned, will make the Egyptians wiser and will improve their memory; I have discovered a potion for memory and for wisdom.” Thamus, however, replied: “O most expert Theuth, one man can give birth to the elements of an art, but only another can judge how they can benefit or harm those who will use them. And now, since you are the father of writing, your affection for it has made you describe its effects as the opposite of what they really are. In fact, it will introduce forgetfulness into the soul of those who learn it: they will not practice using their memory because they will put their trust in writing, which is external and depends on signs that belong to others, instead of trying to remember from the inside, completely on their own. You have not discovered a potion for remembering, but for reminding; you provide your students with the appearance of wisdom, not with its reality. Your invention will enable them to hear many things without being properly taught, and they will imagine that they have come to know much while for the most part they will know nothing. And they will be difficult to get along with, since they will merely appear to be wise instead of really being so.” <https://newlearningonline.com/literacies/chapter-1/socrates-on-the-forgetfulness-that-comes-with-writing https://newlearningonline.com/literacies/chapter-1/socrates-...> Note that this is actually Plato writing what many philosophers consider more a literary than literal work (see, e.g., Peter Adamson of The History of Philosophy podcast and book series), through his character Socrates, who then quotes another, so three levels of nested narrative and storytelling. And while we're noting, "Plato" is itself believed a nickname or pseudonym, with his birth name likely being "Aristocles".
- ZeroGravitas 4y agoThese are sometimes referred to as "dead metaphors" when you lose the mental connection to what originally inspired it: https://en.m.wikipedia.org/wiki/Dead_metaphor https://en.m.wikipedia.org/wiki/Dead_metaphor
- jxf 4y agoWhat a neat little reference. I love finding out that someone, somewhere, has taken the time to put a little sticker on something and say "I think I'll call this idea X".
- bdcp 4y agoYou should name that phenomenon
- AdmiralAsshat 4y agoI wonder if we could add "record scratch noise" into the dead metaphors category, or if we'd need to make a new category for audio relics instead of written ones.
- pinusc 4y agoI'd say that metaphor not quite dead yet. A few generations are younger than CDs, but vinyl still appears in a lot of pop culture (in no small part thanks to nostalgia). I'd wager most teens would know that the vinyl scratch sound is indeed from vinyl, even though most would never have touched a vinyl disc. Dead media, but the metaphor is still fresh enough...
- pedrow 4y ago"Bootstrap" from which we get "booting up" and "reboot" is another one[0] [0]: https://www.etymonline.com/search?q=bootstrap https://www.etymonline.com/search?q=bootstrap
- stevage 4y agoAh that one is only semi dead for me. Hadn't realised that bootstraps weren't the same as bootlaces though.
- mabbo 4y agoI was worried that this would be an article about how boilerplate is never just boilerplate, how it's actually quite important and we shouldn't consider it so lowly. And that's fine. That's a good, valid opinion. Fortunately, we are instead blessed with an etymology post, which is far more delightful to read, in my opinion.
- dr-detroit 4y ago
- aninteger 4y ago> Now that Twitter is on a downward spiral I’m rewriting my favorite tweetstorms in a more permanent medium Thank you!
- dsr_ 4y agoThe once-popular HTML editor HoTMetaL was named after a different part of that process, once someone noted that the letters lined up nicely.
- dredmorbius 4y agoSee also: Moveable Type (<https://en.wikipedia.org/wiki/Movable_Type https://en.wikipedia.org/wiki/Movable_Type>) and Wordpress (<https://en.wikipedia.org/wiki/WordPress https://en.wikipedia.org/wiki/WordPress>). Adobe Pagemaker was originally Aldus, named after Aldus Manutius, a renaissance printer and creator of italic type.
- IIAOPSW 4y agoI've been assuming it has to do with a boiler room operation. You know. The sort of dodgy business posing as a whole team with an office based out of a prestigious locale, but its actually just one guy renting out the basement boiler room so he can use that address without technically lying. He sends the same form letter (possibly a scam) to thousands of potential "clients" per day, changing only the name but keeping it worded as if the addressee was the special object of consideration.
- Agent766 4y agoAs an aside, check out the 30 minute documentary "Farewell Etaoin Shrdlu" (https://www.youtube.com/watch?v=1MGjFKs9bnU https://www.youtube.com/watch?v=1MGjFKs9bnU) about the end of the linotype era. I'm amazed at the engineering that went into linotype printing.
- Taniwha 4y agoI worked in a hot-metal news room (with lino-types) take the parent article with a grain of salt - it really worked like this: 1) Linotype machine contains positive type molds, it assembles them into lines and mechanically left/right justifies them 2) Lino machine pours liquid metal into the line of type to make a negative image (mirror writing) 3) Lino operator runs in k roller over finished article's type and prints a quick copy 4) Copy is sent to readers/copy holders who check the spelling/grammar 5) Lino operator fixes bad lines 6) backwards type articles is sent to subeditors who lay out pages (using fixed type for headlines and including photos) 7) a papermache-like substrate is heat pressed on to the flat page producing a positive image 8) the substrate is bent into a half cylinder and a negative version is cast in to metal 9) the half cylinder is bolted to the main press along with the half cylinder for the facing page 10) the press rolls making positive images and collating all the papers from the different rollers into newpapers So for the record positive->negative->positive->negative->positive to make a hot metal paper
- nine_k 4y agoWell, etymology is fun, but look, the post describes an early mechanism for inclusion of laid-out third-party content into a page! It's like having #include or <iframe> on a newspaper page from 1900.
- deafpolygon 4y agoIt's the nameplate, not the actual boiler plate itself that gets affixed to every boiler. It was eventually required by law, but most manufacturers were already doing it. This is where the term comes from in printing (the boilerplate was the required details for every page that didn't get changed). Then the same was used in code (we used the printing concept of 'boilerplate'), the required element for code in order to get started with a project.
- scarecrowbob 4y agoThis might be an interesting sidebar: https://en.wikipedia.org/wiki/Boilerplate_(spaceflight) https://en.wikipedia.org/wiki/Boilerplate_(spaceflight) The origin of the term in spaceflight (according to the wiki, at least) is that they were literally constructing full-size / full-weight mock ups of capsules from steel: "The term boilerplate originated from the use of boilerplate steel[3] for the construction of test articles/mock-ups. Historically, during the development of the Little Joe series of 7 launch vehicles, there was only one actual boilerplate capsule and it was called such since its conical section was made of steel at the Norfolk Naval Shipyard. This capsule was used in a beach abort test, and then subsequently used in the LJ1A flight. However, the term subsequently came to be used for all the prototype capsules (which in their own right were nearly as complicated as the orbital capsules). This usage was technically incorrect, as those other capsules were not made of boilerplate, but the boilerplate term had effectively been genericized.[citation needed]"
- bell-cot 4y agoMy quick take - think of mid-nineteenth-century foundries and machine shops. Generally very small-scale, ~zero automation, no mass production. Almost every non-trivial thing (say, a little steam engine) that they made would involve a lot of castings, followed by a whole lot of steps where skilled machinists would cut, turn (on a lathe), drill, polish, rivet, etc. the castings, to make the finished product. In that context, making metal plates for (steam) boilers would be one of the dullest and most repetitive work sorts of work that they'd do.
- froggertoaster 4y ago> Now that Twitter is on a downward spiral If you open your article with hyperbole, don't be surprised if I take the rest of the article with a huge grain of salt.
- xdennis 4y agoI don't agree that it's a hyperbole. A hyperbole is something ridiculous like "I'm so hungry I could eat 1000 pizzas" which is physically impossible. Twitter _is_ on shaky ground. Maybe it will recover and soar, but it's not an exaggeration that it could spiral down.
- froggertoaster 4y agoOkay. Glad your data backed analysis with the data you've shared (outside of your observations of mentally unstable individuals of course) has yielded that "Twitter _is_ on shaky ground". Oh you haven't shared any data? Oh yeah. Okay.
- butterNaN 4y ago> Now that Twitter is on a downward spiral I’m rewriting my favorite tweetstorms in a more permanent medium, This is much welcomed! Too many interesting things I missed because they were presented in a fragmented series of thoughts on twitter. I would just never open those links because the experience was jarring. If twitter chaos means people joining the article writers crowd, what a gain!
- v3ss0n 4y agoWhat a coincidence, I was just thinking about it this morning, but too lazy to Google. NOW this shows up on HN and it's not on Facebook. What trickery is that?
- artificialLimbs 4y agoHivemind is the meme terminology. You might look up Jung's 'sychronicity'.
- Eleison23 4y agoLet's just put this in real-world terms we all can understand here. If I sign up to an MMORPG and I'm outfitting my Paladin, should I choose the "boiler plate mail"? Does a space matter?
- weitzj 4y agoI had a really dumb look on my face when I realized what a firmware is: hardware - firmware - software
- mewse-hn 4y agoHilarious the computer programmers in here who know the actual etymology of the term like they were around 100 years ago when the term spread from printing presses to the legal field
- stewx 4y agoFunny. Our professor told us it was called that because a boiler plate is something you cook on, like a griddle or hot plate. You can't cook your food until that basic element is in place.
- ConnorCallahan 4y agoWhy is twitter in a downward spiral?
- Moctogo 4y agoIt really is not. If anything, the experience has improved in the last couple of days. There seems to be a surprisingly big subset of the population that hates Elon Musk and thinks he can do no good. It as if they want Twitter to fail just so they can be vindicated.
- nonameking2026 4y agoAnd they keep calling him stupid. It is actually quite entertaining.
- francisofascii 4y agoI think it is fair to say the employee experience is in a downward spiral.
- effnorwood 4y ago
- computomatic 4y agoInteresting history, for sure! That said, I can’t help but feel like this one premise is unsubstantiated. > But where does it get the meaning of being “uncreative” copy-paste code? I’ve never heard of boilerplate being described in quite those terms. In my experience, boilerplate is frowned upon for exactly one reason: we tend to type it out manually despite the fact that it never differs. That’s something that coders know should be automated, and it’s a waste of energy when it’s not. The exact same problem linotype and boilerplate molds solved. Perhaps I’m simply missing the point and splitting hairs.
- ozim 4y agoI always see boilerplate in connection with code generators or creators that will create boilerplate code that one can adjust. Some people nag they write boilerplate code but for me it seems they never found ways to automate it or simply copy paste.
- stevage 4y agoThe article somehow jumps from defining boiler plate (the metal) to its use as slang in printing. Is there a bit missing?
- andix 4y agoInteresting post. But much more important question: Why is boilerplate code still a thing? Either create a library or a code generator. The difference of a code generator is, that you don’t edit the generated code, just the parameters of the generator. Boilerplate code or scaffolding is just a nice word for „copy and paste with slight modifications“
- dredmorbius 4y agoAn element of writing and publishing that's become increasingly interesting to me are writers who also ran presses themselves. Mark Twain comes to mind --- he'd been an assistant in his own brother's print shop, and (checking Wikipedia just now as I write this), one of his earliest photgraphs shows Twain holding a composing stick of hot-metal type. Twain seems to me to know the physicality of words and language, as well as the full process from idea to composition to typesetting to printing to distribution. His professional life spanned the period over which telegraphy emerged as a dominant factor in long-distance communication, where printing increased in speed from perhaps 100 impressions an hour to a million or more, and where the typewriter replaced handwritten manuscripts and correspondence. He also struggled with the economics of writing and publishing, contemplating suicide in San Francisco with a nickle and a revolver to his name, being bailed out by his father-in-law and a Standard Oil executive, and going through bankruptcy. This all by a man now considered among the very best authors the United States has produced. The market can very much be an ass.
- nl 4y ago"Boilerplate" was in use in legal circles as early as 1865: https://www.google.com.au/books/edition/Advisory_Opinions_on_the_Open_Meetings_L/qbnXkPANkLEC?hl=en&gbpv=1&bsq=boilerplate https://www.google.com.au/books/edition/Advisory_Opinions_on... - well earlier than the 1895 this article claims. This was 20 years before the invention of the linotype machine (1884) that this author claims it was named after. In 1896 "The Typographical Journal" did use "boiler plate" to refer to the type of printing process, but not to it being a pro-forma piece of information: https://www.google.com.au/books/edition/The_Typographical_Journal/pKAuAQAAIAAJ?hl=en&gbpv=1 https://www.google.com.au/books/edition/The_Typographical_Jo... "Boilerplate" also refers to the branding plates that were placed on boilers that contained repeated information on every boiler. I think it's more likely the term comes from that. It's annoying the author isn't on twitter where this could be corrected!
- hwayne 4y agoAuthor here, looking into those earlier sources now EDIT: The "Advisory Opinions" source is mislabeled and was published after 1989. [1] The "Typographic Journal" refers to boiler plate as a derogative for a low quality newspaper: > The next city visited was Paris, Ill. which "supports" four newspapers. The only one worthy of mention is the Beacon … The other newspapers thive on "boiler plates" exclusively [2] [1] https://www.google.com.au/books/edition/Advisory_Opinions_on_the_Open_Meetings_L/qbnXkPANkLEC?hl=en&gbpv=1&bsq=1989 https://www.google.com.au/books/edition/Advisory_Opinions_on... [2] https://www.google.com.au/books/edition/The_Typographical_Journal/pKAuAQAAIAAJ?hl=en&gbpv=1&bsq=boiler https://www.google.com.au/books/edition/The_Typographical_Jo...
- nl 4y agoAgree "Advisory Opinions" was mislabeled. That's annoying. My point about "Typographic Journal" is that their usage is quite different - they are using it as a synonym for low quality, not the kind of fill-in-the-blanks usage we see now. In 1851 "De Bows Review"[1] talks about how it is a felony to use unstamped boiler-plate, conceal the plate on the boiler-plate or counterfeit the stamp. To me that goes to filling-in of boilerplate with details (using the stamp) which seems a more likely origin than the "lower quality" usage used by "Typographic Journal". [1] https://www.google.com.au/books/edition/De_Bow_s_Review/y5wRAAAAYAAJ?hl=en&gbpv=1&dq=boilerplate+language&pg=PA96&printsec=frontcover https://www.google.com.au/books/edition/De_Bow_s_Review/y5wR... (and see page vii which shows this was published in 1851)
- danielrhodes 4y agoYou can find the etymology on Wikipedia. https://en.wikipedia.org/wiki/Boilerplate_text https://en.wikipedia.org/wiki/Boilerplate_text It was a term used in printing presses for text/content that could be reused. > "Boiler plate" originally referred to the rolled steel used to make boilers to heat water. Metal printing plates (type metal) used in hot metal typesetting of prepared text such as advertisements or syndicated columns were distributed to small, local newspapers, and became known as 'boilerplates' by analogy. One large supplier to newspapers of this kind of boilerplate was the Western Newspaper Union, which supplied "ready-to-print stories [which] contained national or international news" to papers with smaller geographic footprints, which could include advertisements pre-printed next to the conventional content. The same can be true of boilerplate code, which in the same article is defined as > the sections of code that have to be included in many places with little or no alteration
- KurvaKing 4y ago