The word bug in reference to a computer glitch has actually been used by engineers to refer to mechanical defects as far back as the 1870s, on the notion of an actual insect getting into the machine. And it was still used in that half-serious, half-joking sense through the early computing age—notably, it was popularized in 1946 after scientists at the Harvard Computation Laboratory identified an actual moth in the machine as a cause of a malfunction in the Mark II computer. Unsurprisingly, the verb to bug meaning "annoy" also came from the insect, through a connection of them being perceived as irritating; as did to bug meaning "secretly electronically monitor" because of the idea of hidden cameras and microphones being the size of actual bugs. Finally, the noun bug has an unknown origin, but was probably somehow connected to the Middle English word bugge, meaning "something frightening" (this is also the source of bugbear and bugaboo).
Hello! I'm Adam Aleksic. This year, I graduated from Harvard University with a degree in Government and Linguistics. There, I co-founded the Harvard Undergraduate Linguistics Society and wrote a thesis on Serbo-Croatian language policy, magna cum laude. In addition to etymology, I also really enjoy philosophy, trivia, vexillology, geography, board games, conlanging, art history, and law.