A comma sets off a parenthetical element. This “pathetic element” is subordinate to the essential meaning of the sentence. This is the hardest comma rule, because it is hard to tell when an element is non-essential.
In the card above, we could say:
EX: Sorry your someecard is completely devoid of punctuation which would have been awesome had you just added a comma.
The essential point of the sentence is your ecard was ruined by not having a comma. The parenthetical phrase, “making it impossible to get the joke”, gives us additional information or insight into the sentence, but isn’t necessary to understand the point of the sentence.
The following element is needed for the meaning of the sentence, because the writer is not saying that “Everyone deserves a hug.” This is a restrictive clause.
EX: Everyone who gave my grandmother flowers deserves a hug.
One exception to this rule is when the parenthetical element occurs after a conjunction between two independent clauses.
WRONG: Watermelon is messy, but, of course, I like it.
RIGHT: Watermelon is messy, but of course, I like it.
Infinitives, participles, and nonessential appositives are always set off by commas.
Infinitives begin with “to”.
To stay with him, she must truly love him.
Participle (modifies the subject of the independent clause)
A phrase opening with a verb in the present (-ing) or past participle (-ed) must be followed by a comma (and the modified object) might be confused with an introductory comma. But a participle is always set off by commas.
EX: Jumping through the air, Dave landed on his butt.
EX: Destroyed in seconds, the city couldn’t withstand the impact of the meteor.
EX: Built hundreds of years ago, the building barely stands today.
EX: The man, cursing like a sailor, stormed off.
Nonessential appositive (immediately precedes or follows a noun)
A phrase that modifies the following noun.
EX: An avid adopter of children, my mother is a selfless woman.