"The Cop and the Anthem" is one of O. Henry's best and most typical stories. Two devices he uses to make his story interesting and effective are irony and humor, both of which are characteristic of O. Henry, and both of which serve a similar purpose.
Soapy, the protagonist, is a homeless man who sleeps on park benches. He knows from many signs that winter is coming, and he cannot survive in New York City during one of their icy winters. O. Henry often comes up with some striking metaphors, such as:
A dead leaf fell in Soapy's lap. That was Jack Frost's card. Jack is kind to the regular denizens of Marison Square, and gives fair warning of his annual call.
The irony is pretty obvious. Soapy tries many different ways of getting himself arrested. His versatility characterizes him as having years of experience in living without working. It seems ludicrous that a man should be deliberately and assiduously trying to get arrested and sent to jail. Just when he has decided to get a steady job and reform, he gets arrested and sent to jail for vagrancy.
The humor is contained in the situations and in the hyperbole of O. Henry's style. Soapy actually tries throwing a cobblestone through a plate-glass store-window and the cop won't arrest him because he can't believe the perpetrator wouldn't have run away. He tries molesting a female window-shopper and she ends up catching his coat sleeve and saying:
"Sure, Mike. If you'll blow me to a pail of suds. I've have spoke to you sooner, but the cop was watching."
The story was written in 1905. Beer was often dispensed by saloons in metal pails with handles to "take out." A typical pail must have contained about a quart of "suds." It may have been that women were not admitted to all saloons, so the one who picked up Soapy might have wanted him to bring it outside to her. Otherwise, patrons would drink their beer out of glasses or mugs inside the establishment.
O. Henry is describing a wretched man in danger of freezing to death and trying to save his life. Yet he does it with humor and poetic expression. O. Henry is showing the reader the dignity, courage, and poetry to be found at the bottom of the social ladder. His story is an example of what Shelley says in his famous poem "To a Skylark":
We look before and after
And pine for what is not
Our sincerest laughter
With some pain is fraught;
Our sweetest songs are those that tell of saddest thought.
Theodore Dreiser wrote about the wretched existence of the homeless of New York City in his marvelous depiction of the downward descent of Geprge Hurstwood in the later part of his novel Sister Carrie. Unlike O. Henry, Dreiser did not see any humor or beauty in the lower depths, but he knew what they were like from personal experience, and he describes Hurstwood's slow, relentless path towards eventual suicide in a flophouse in meticulous detail.