In the United States, commas and periods go inside quotation marks, regardless of logic. Colons and semicolons go outside the quotation marks, regardless of logic. And question marks and exclamation points go in or out, depending on the logic. That is our convention. You learned it, or should have, in elementary school.
In the UK (and other places where British English is written), the convention is that logic rules in all cases. Thus, a comma or period may occur outside the quotation marks if it is not part of the material being quoted.
Fine. You knew that.
And you may also know that some Americans, particularly people with some background in computer programming, would very much like it if American editors and typographers would switch to the British system, as this would greatly simplify the problem of rendering computer code unambiguously. But let’s not get into that issue just now.
What I want to talk about here is the history of the divide between the U.S. and UK conventions.
There are several stories floating around—urban myths—that setting the period inside the quotes arose because compositors might otherwise lose or break those fragile, small periods, back in the days of hand composition. I can tell you, having set type by hand myself, that this is nonsense. First, most punctuation occurs in the middle of a line of type, not at the end. Second, the period is no more fragile or likelier to be dropped than a quotation mark if it should happen to occur at the end of a line. There would be no reason for a compositor to care one way or the other. Please stop spreading that story.
So what’s the true story?
The true story is that the divide is of recent origin. British typographers followed the same convention as American typographers well into the twentieth century. The switch to logical punctuation in the UK took place within the memory of people now living. I have not tracked down a definitive date, but the change did not occur until at least the 1930s and possibly a decade or more later, in any case long after the bulk of composition was done on machines, not by hand. Just as the British eventually adopted the metric system and we Americans dug in our heels, so too in this case, the right-pondians made a conscious decision to right what they felt was a logical abomination while we stayed true to the older system.
But what was the point in the first place? I’m still digging, but my guess is that the principal consideration was aesthetic. With metal types, placing a period or comma after a quotation mark creates an unsightly gap in the line and thus a pigeonhole on the page. For most of the history of printing from moveable type, that has been something to avoid if possible. With modern typesetting software, the problem can be mitigated through prudent kerning, but that’s a quite recent development.
Will we in the U.S. adopt the British system? Maybe in a few gigaseconds.