A comma is a versatile punctuation mark, serving 10 basic functions. Here’s an enumeration, with examples.
1. Separate the elements in a series: “Groucho, Harpo, and Chico developed the philosophy called Marxism.”
Many periodicals and websites, and most colloquially written books, omit the serial, or final, comma, but it is all but mandatory in formal writing and is recommended in all usage. As language maven Bryan Garner observes, “Omitting the serial comma may cause ambiguities, whereas including it never will.”
2. Separate coordinated independent clauses: “I like the Marx Brothers, but she thinks they’re too silly.” (An independent clause is one that can stand on its own as a sentence but is linked with another by a conjunction and/or a punctuation mark.)
Exceptions include sentences with closely linked clauses (“Go to the window and see who’s there”) and those with a compound predicate (“The Marx Brothers are known for their puns and their sight gags”).