Origin of "son of a gun"
Growing up there was a friend of my family who would often use son of a gun as a slang term. For example,
And that son of a gun has a 300hp motor in it.
Like any father, my Dad wanted to raise me right, so he banned me from using the phrase. He implied that the phrase was synonymous with son of a bitch. However in more recent years I've often wondered: What is the origin of son of a gun, and does it really have anything to do with illicit relationships?
The Phrase Finder writes that etymologists are at odds about where this phrase actually originated from. They write that there are two options:
The phrase originated as 'son of a military man' (i.e. a gun). The most commonly repeated version in this strand is that the British Navy used to allow women to live on naval ships. Any child born on board who had uncertain paternity would be listed in the ship's log as 'son of a gun'. While it is attestable fact that, although the Royal navy had rules against it, they did turn a blind eye to women (wives or prostitutes) joining sailors on voyages, so this version has plausibility on its side.
The term is euphemistic and derived as a conveniently rhyming alternative to 'son of a bitch/whore'. That term has been part of the language for centuries, certainly long enough for people to some up with a euphemism for it. Shakespeare used something like it in King Lear, 1605 - "One that art nothing but the composition of a Knave, Begger, Coward, Pandar, and the Sonne and Heire of a Mungrill Bitch."
There are sourced examples which support either of these hypotheses. For example, there is 19th century literature supporting the second option as well as 19th century examples supporting the first. Both options, however, lead to the conclusion that the phrase is a euphemism for son of a bitch.
That's what wikipedia has to say about this idiom:
British English It is claimed that in British naval slang this term refers to a child of questionable parentage conceived on the gun deck, hence 'son of a gun'. However, the term possibly predates this claimed origin, and Snopes.com lists it as being part of the English lexicon since at least 1708.1 It is sometimes claimed that the saying has its origin in the supposed practice of women travelling on board ship and giving birth on a sectioned off portion of the gun deck. For instance, Admiral William Henry Smyth wrote in his 1867 book, The Sailor's Word-Book:[2] Son of a gun, an epithet conveying contempt in a slight degree, and originally applied to boys born afloat, when women were permitted to accompany their husbands to sea; one admiral declared he literally was thus cradled, under the breast of a gun-carriage.
American English In American folk idiom (American), this term has similar meaning to the British one, but was derived from military bureaucratic treatment of young enlisted men of uncertain familial background. If a recruit was unable to state his father's name, officers recorded "A. Gun".[citation needed]
An urban legend sometimes states that a story reported in the October 7, 1864 The American Medical Weekly about a woman impregnated by a bullet that went through a soldier's scrotum and into her abdomen was the origin of the term "son of a gun." The story about the woman was a joke written by Dr. Legrand G. Capers; some people who read the weekly failed to realize that the story was a joke and reported it as true.[3]
In some sense your Dad was right about its meaning.
To flesh out a little historical detail:
The primary defense of England from roughly 1700-1840s, was the Channel Fleet a powerful fleet kept permanently on station tacking upwind of the southern entrance to the "English" (and they wanted to keep it that way) channel. Unlike other fleets or individual ships, the Channel fleet never went anywhere it just tacked back and forth in a small area just to have the wind gauge so they could intercept any one trying to reach England or block the channel.
With the shore and home "just right over there" the Channel fleet developed several practices not found in the rest of the British Navy. One of them was allowing wives aboard ship. Although, contrary to common sources, it appears this allowance was restricted to officers, both commissioned and warranted, unless the ship was actually in port. Because the ships spent weeks or months on station and women of reproductive age at that time spent 2/3rds of their life pregnant or nursing, births at sea were inevitable.
On ship, sailors on warships lived and ate on the gun deck literally squeezed around the guns so in the popular imagination, any birth at sea to a wife of the crew would have to happened on the gun deck between the guns, hence "son of a gun."
In reality, they would give birth in a either the officers cabin, the surgeons cockpit in the bow or weather permitting, on the deck.
Pretty sure one of Nelson's officers famously recorded the birth of "a son of the gun" to his Master Mate's wife.