Etymology of a URL Slug
Hint: Phylum Mollusca is Not Implicated...probably
Earlier today, on Twitter,How most of my 2020 stories begin… I jokingly asked the hive about the origins of the world ‘slug’ in the context of clean URLs.
Who the ever-loving fuck decided human readable URLs should be called 'slugs' and how did they come to this stunning conclusion?— (wannabe) Ƀreaker of (the Bad) Loops (@generativist) December 23, 2020
Because my mutuals are pretty great, I got a (comprehensive in the aggregate) answer within minutes. As Lawrence of Dystopia informed me, it’s related to printed newspapers and Linotype machines. In a stackoverflow answer answer that Lawrence linked, Praveen writes,
The term “slug” has to do with casting metal—lead, in this case—out of which the press fonts were made. Every paper then had its fonts factory regularly re-melted and recast in fresh molds, since after many prints they became worn out.
Typographs had to compose the text of an article in a backward manner with lead characters stacked in a wise. So at printing time the letters would be straight on the paper. All typographs could read the newspaper mirrored as fast as the printed one. Therefore the slugs, (like snails) also the slow stories (the last to be fixed) were many on the bench waiting, solely identified by their fist [sp] letters, mostly the whole title generally more readable [emphasis added].
Wes Miller pointed me to the wikipedia page on slugs in publishing, which confirmed the Linotype machine connection. At this point, I felt compelled to figure out exactly what a Linotype machine was because I didn’t actually know. Apparently,
The name of the machine comes from the fact that it produces an entire line of metal type at once, hence a line-o’-type [emphasis added], a significant improvement over the previous industry standard, i.e., manual, letter-by-letter typesetting using a composing stick and shallow subdivided trays, called “cases” […] The linotype machine operator enters text on a 90-character keyboard.The Lineotype machine was not PEP80 complaint The machine assembles matrices, which are molds for the letter forms, in a line. The assembled line is then cast as a single piece, called a slug, from molten type metal in a process known as hot metal typesetting. [emphasis added]
The slug, apparently, looks like,
So Chris Thomier’s claim seems true – it’s “[l]egacy from newspaper days - like ‘pages’ [and] ‘columns.’” And, as Chris Anderson said, it refers to something shorter than a headline.It will never stop being cool to me that Twitter lets me interact with the guy who wrote The Long Tail. He’s done way more than that – like being the editor-in-chief of Wired for 11 years and, most recently, founding a robotic company. But, that book was formational for me in a lot of ways. Twitter is good. The example he gave was “brexit nodeal.” The one Nathan Lawrence gave was “FED STIMBILL.” This may also be related to slug lines in screenplays which occur at the start of every scene and summarizes if it occurs inside or outside, the specific location, and the time of day.
It’s a remnant of the printing press that probably owes its origin to “slug of metal” but perhaps invoked the mollusk as a way of initiating “slow stories.”The latter claim seems dubious to me, but I like the idea of it so it’s still here. But, as paxdiablo writes, it also provided a handy pointer for editors. “Have you fixed those errors in the ‘kate-and-william’ story?”
You can kinda see why it got reused for clean URLs.