The first computer bug was a literal bug.

To be exact, a moth.

On Sept 9, 1947, a moth got trapped in Harvard University's Mark II computer -- causing multiple errors.

This bug disrupted the electronics inside the Mark II.

Here's a photo of that first computer bug.

@atomicpoet i'm curious, is this why the name "bug" was given to computer errors?
@ipg Yes.

@atomicpoet I remember reading the word "bug" was used way before 1947.

I could only find Edison's use of it in 1878 but I remember reading about an even older reference but a quick search didn't help me find it.

Edited to add link to source: https://interestingengineering.com/innovation/the-origin-of-the-term-computer-bug

@ipg

What is the origin of the term "computer bug"?

Computer bugs are occupational hazards for programmers and software developers. But have you ever wondered about the origin of the term computer bug?

Interesting Engineering
@hvangalen Insects appear to have a propensity to get into places they should not.
@hvangalen @atomicpoet @ipg
From Oxford English Dictionary
@hvangalen @atomicpoet @ipg I'm a librarian (at MIT). I can't help myself.   🤓

@Dlenares @atomicpoet @ipg Cool, yeah that rings a bell! I remember that originally 'bug' already meant a glitch in a system and was in use before computers were a thing. The first *computer bug* is of course still the one mentioned by the OP, which poetically happened to be a real bug.

Thanks for looking it up!

@hvangalen @Dlenares @atomicpoet @ipg
Love this discussion on the origin of bugs in computers and other machines 😍
So for code debugging, one should be using insecticide, naphthalene, or similar.
@TatianaIlyina @hvangalen @Dlenares @atomicpoet @ipg Why not DDT ? It's been a while, but CP/M's Dynamic Debugging Tool (DDT) worked pretty well as I recall.
@hembrow @hvangalen @Dlenares @atomicpoet @ipg
OMG, yes DDT and I thought of Dichlorodiphenyltrichloroethane which was banned in 1970s 😅
@TatianaIlyina @hvangalen @Dlenares @atomicpoet @ipg It was only banned in some parts of the world, and then of course we replaced it with a multitude of other insecticides with all sorts of other effects.
An aside: In the early 70s, when I was still in primary school and years before I used CP/M, we did a school play about bioaccumulation and DDT. This was well after "Silent Spring" of course and these problems were quite common knowledge but for some reason we just keep using that stuff anyway.
@hembrow @hvangalen @Dlenares @atomicpoet @ipg
More than half a century after Silent Spring and we write doctoral dissertations on the topic. Mine was actually about modeling the fate of pollutants like pesticides and insecticides in the sea.
@hembrow @TatianaIlyina @Dlenares @atomicpoet @ipg Haha I just made a DDT joke totally unaware that it already did exist. Of course it does, because many coders are a funny bunch!

@TatianaIlyina Someone called Daisy should create and release a Debugging Toolkit. 😅

@Dlenares @atomicpoet @ipg

@hvangalen @atomicpoet @ipg i remember that too, "bugs" have been called bugs before. hopper quipped when finding out a literal bug caused the error, she didn't invent it. https://en.wikipedia.org/wiki/Software_bug?wprov=sfla1
Software bug - Wikipedia

@atomicpoet

@ipg

The sentence "first actual case of bug being found" suggests the word was already in use with that sense before the incident.

@atomicpoet @ipg
A moth is not a bug...
Neither is a month, which is what spell check would have had me post.
The use of "bug" to meant a fault in a system predates that, and was part of the reason that was logged, for being a literal bug rather than only a figurative one.
That's why it says "First actual case of 'bug' being found".
@atomicpoet no idea if this is real or fake but I love it so much!
Grace Hopper's Bug

A computer bug so primitive it was an actual insect.

Atlas Obscura
@atomicpoet @Nijay "Though the moth anecdote is often falsely credited with the creation of the computing terms “bug” and “debug” (these were actually used as early as Edison), it accurately provides a glimpse of the wit and cleverness of Admiral Grace Hopper."
@Nijay @atomicpoet It is real. It became trapped in a (mechanical) relay.
@atomicpoet If Britain had carried on developing computers after the War then bugs would be called Creepy Crawlies.
@atomicpoet And this is why a patch is named "patch"
@atomicpoet And in fact, this was the origin of the term “software bug.”
@krayneum @atomicpoet from the article posted above "Though the moth anecdote is often falsely credited with the creation of the computing terms “bug” and “debug” (these were actually used as early as Edison), it accurately provides a glimpse of the wit and cleverness of Admiral Grace Hopper."
@FakePlasticDunk @atomicpoet This is what I get for fact-checking myself against Wikipedia.
@atomicpoet Admiral Grace Hopper who found the first "bug" was an amazing technologist and doesn't get the recognition she deserves imho. One of my IT heros!

@atomicpoet Actually, the term "bug" was already used for at least 50 years ! And this paper was probably a joke :)

https://daily.jstor.org/the-bug-in-the-computer-bug-story/

The Bug in the Computer Bug Story - JSTOR Daily

Soon after a team of engineers discovered a moth in a machine at Harvard, the word "bug" became a standard part of the programmer's lexicon. Or did it?

JSTOR Daily
@atomicpoet That might also count as the first incident report.
@atomicpoet they named that moth Elon Musk
@atomicpoet Sorry, this one’s an urban legend, have a read of https://ourplnt.com/first-computer-bug/. The term has been used for a lot longer than that.
The first "actual" computer bug was found on September 9, 1947 - Our Planet

On Sep. 9, 1947, programmers traced an error and found a moth trapped in a relay. Some say this was the first case of a computer bug, but it's not true.

Our Planet
@atomicpoet This is part of our origin story. Do we know which species?
@atomicpoet interesting I knew it was a physical bug, but I al aya thought it was a beetle, no idea why 🤷‍♀️
@atomicpoet
It took me a little bit to realize that that's not a photo of the moth, it's the actual moth taped to the report.
@atomicpoet some insight from someone that writes code to help manufacture microprocessors; This is a great story and a great pun. Having a moth in a relay is literally a computer bug, not to be confused with a bug in software. A literal bug in software that fulfills the requirement for a pun would need a line of code such as >> if('moth'): where 'moth' is not an argument that can be parsed by if() thus causing an error in execution, introduced by a literal moth in the code, get it ... literal

@atomicpoet And coined by Admiral Grace Hopper, a programming pioneer.

#WomenInTech #WomenInCS

@atomicpoet

Tuttle becomes Buttle, and it's all down hill from there.

@atomicpoet (moth) in relay

what a banger of a band name

@atomicpoet The term 'bug' for 'fault, problem' dates from 14th c. ME 'bugge' (scarecrow, demon, hobgoblin), blamed for unexpected problems. The term eventually referred to the problems themselves.

As the note shows, what made this case notable was that it was an ACTUAL bug (insect), which would have been funny because of the coincidence of terms. The etymology of the term 'bug' for living creatures is different.

It was not the first computer bug, but it was the first caused BY a bug.

@atomicpoet We're backing you up: it's a fact on our Grace Hopper card in our SCIENTISTS game - it must be true! 😀 #stem
@atomicpoet it's important (ok, important only to me probably) to know that they did that because bugs were already a metaphor for glitches in radio equipment etc. during WW2 and earlier (the OED has an instance from 1875), so the joke here was that the bug was an actual bug this time, I hope this footnote contributes to everyone's enjoyment of the humour
@atomicpoet what synchronicity - I just found this out today whilst teaching my year 9s to talk to a rubber duck to help them problem solve! I may also have bought them a whole bunch of rubber ducks to talk to 🤣

@atomicpoet Back in college one of our teachers told us about this incident, he had a very humorous style and made the occasional wife joke. Between the laughs we learned how the first computer bug had been fried in the vacuum tubes, causing the malfunction.

(turns out it wasn't a vacuum tube, it was a relay, so perhaps it got electrocuted instead of burnt?)

Anyway, the programmer wins: It was a hardware error 😁

@yuki2501 @atomicpoet It was not really the first computer bug, "bug" was already a well-known term for design errors in engineering slang. Grace Hopper's note said that it was the "first actual case of bug", implying the existence of previous imaginary bugs.
@atomicpoet @Holberg and this was born the phrase, “It’s not a bug, it’s a feature!”
@atomicpoet I love that the first computer bug was, in fact, a bug
CHARLIE AND LOLA: BUT THAT IS MY BOOK WITH ENGLISH SUBTITLES.flv

YouTube
@atomicpoet Oh wow! I never knew that, but it makes sense. Bug in the hardware, bug in the software.

@atomicpoet I so want this to be the first and to be true - but I’m going to be contrarian. If you read the annotation under the moth, it reads “first actual case of bug being found”.

To me that suggests that the term ‘bug’ was already in use and the writer was wryly amused that this bug was caused by an actual bug.

#PartyPooper

@atomicpoet The bug was discovered by Dr. Grace Hopper, who invented COBOL, helped build UNIVAC, and is the only computer programmer to have a battleship named after them.

https://en.m.wikipedia.org/wiki/Grace_Hopper

Grace Hopper - Wikipedia