It's taken me a week to write this article, in part due to formidable college work, in part due to this being the hardest topic I've attempted to cover. By no means do I intend this to be the end all be all of commas, but I hope to give my dear readers a decent sense of how to use them and why to use them.
The modern comma was invented by Aldus Manutius during the renaissance. His purpose was to clarify the sentence, though we have since slightly changed the comma's meaning. When it comes to placing commas nowadays, there are two general schools of thought: One uses them by ear, placing them where natural pauses occur in the sentence. The other uses them according to grammatical guidelines in order to clarify the structure and parts of a sentence. I hold to the grammatical perspective, because it is the only logical way to place commas. Placing commas by ear is subjective and thus prone to inconsistency. Without further ado, let's get to some examples.
In a list of more than two elements, place a comma between each, including the comma before the last item of the list (the serial comma). You can find plenty of arguments across the web for the serial comma including this website, so I won't bother to go into greater detail. If your list has parenthetical statements within the list, you can use semicolons instead of commas, though this is less frequent.
Incorrect: I bought eggs ham bacon spam and eggs. He gave his paper to John, his teacher, Wallace, his father, and Bart, his friend.
Correct: I bought eggs, ham, bacon, spam, and eggs. He gave his paper to John, his teacher; Wallace, his father; and Bart, his friend.
Commas should separate independent clauses. An independent clause is one that contains both subject and predicate. In bastardized form, an independent clause could (sort of) stand as its own sentence.
Incorrect: I'm a student and he's a professor. We prepared dinner before sunset but we didn't eat until well after sundown.
Correct: I'm a student, and he's a professor. We prepared dinner before sunset, but we didn't eat until well after sundown.
Separate parenthetical statements within sentences with commas both before and after. You may hear parenthetical clauses referred to as non-restrictive clauses. It means the same thing. There is some confusion between that and which in relation to these clauses. They are technically interchangeable, but tradition has which reserved for non-restrictive clauses (parenthetical statements), while that reserved for restrictive clauses. For humans, use who.
Incorrect: The teacher an old and frail man struck his fist with great fortitude. The tree which stood at the corner, burnt down.
Correct: The teacher, an old and frail man, struck his fist with great fortitude. The tree, which stood at the corner, burnt down.
Separate an introductory clause with a comma. The New Yorker adds that no comma should come if the introductory clause follows a conjunction.
Incorrect: If two lights show strike by air. But if one light shows, strike by land.
Correct: If two lights show, strike by air. But if one light shows strike by land.
Greetings and closings follow with a comma.
Incorrect: Dear John (...) Sincerely
Correct: Dear John, (...) Sincerely,
Depending on how you write dates, you will need commas.
Incorrect: 21, September 1994. September 21 1994.
Correct: 21 September 1994. September 21, 1994.
Use commas in an address to separate street, city, and state.
Incorrect: 21 Maybury St. Cleveland Ohio.
Correct: 21 Maybury St., Cleveland, Ohio.