What are the rules on when to use commas, colons, semicolons and dashes?
These are my rules of thumb (so they are not meant to be rigorous specifications of when each mark is to be used and when each is not to be used):
First, the comma and semicolon have similar functions (though the former is more flexible than the latter), but the colon has a very different function.
Either a comma or a semicolon can be used to separate independent clauses. Generally a semicolon carries greater weight and offers a more noticeable sense of separation between the clauses than does a comma. It's notable that when a comma is used for this purpose a conjunction must follow the comma, but no conjunction is necessary when a semicolon is used. Often the conjunction conveys a small bit of extra information, so to use a semicolon is to sacrifice this information. ("I like this band, but my brother doesn't." -- "I like this band; my brother doesn't." In this example "but" reinforces the notion that what follows it is contrary to what precedes it. From an information-theoretic perspective this is redundant as this relationship between the two clauses is easily deduced from the version with the semicolon, but as we know the goal of writing is not so much about efficiency as it is about effectiveness.)
I was taught when young to use a comma whenever you would take a breath were you to read the sentence aloud. I generally never follow this rule and recommend others to ignore it as well. This tends to lead to a proliferation of unnecessary comma splices and similar misguided constructions. For instance, sometimes when speaking you might, in a flash of insight, say the word "although" loudly, pause for a second or so, and then release your insight on your listeners. You might be tempted to write as follows: "Although, by considering this viewpoint we find..." This would be much better without the comma.
Commas serve some extra purposes that semicolons certainly do not. For instance, they can be used to separate an appositive from its surrounding environment. ("My cat, a massive fur ball, does nothing but sleep.") Comma usage is actually pretty nontrivial, and I can't hope to provide any sort of comprehensive overview here. Try to figure out the meaning of the following sentence: "My friends went to the supermarket with Dave, a teacher, and a computer technician." Is "a teacher" an appositive for Dave or is it the second item in a list of three items? Here's another example. The word "then" is not a conjunction, so it shouldn't be used to separate independent clauses. And yet there are cases where we do just that: "Add an egg to the bowl, then add in some milk." The explanation? It's functioning as an adverb here!
I would use a dash in one of two ways. (1) Two dashes are placed around an intermittent phrase, bringing sharp attention to this phrase and not misleading the reader into thinking it is less important than its containing sentence. ("The spy--who, I remind you, was only thought to have been eliminated but now waited behind the bushes--was about to fall asleep when a rustling of leaves in the distance followed by whisperings reminded him that he was not alone.") (2) This is essentially the same as (1), except the phrase is placed at the end of the sentence, so it is preceded by a dash but followed by a period.
Finally, my rules of thumb with colons are that they should be (1) preceded by a complete sentence and (2) followed by a list. I sometimes (but not commonly) break the second rule, but I never break the first. For instance, I might break (2) if I need some particular point to really be emphasized as the definitive thing to remember from the sentence. "Regarding the latest WikiLeaks release, we must absolutely bear in mind the following point: [the key to understanding the whole situation]."
Dashes. There are three commonly used dashes in English.
- Hyphen - Joins two words as a single concept. Often the hyphen is omitted when the word pair enters common usage as a compound word. "First-class." At one point the word may have been "extra-terrestrial" but the hyphen is now omitted.
- n-dash – (width of an 'n') Indicates a from–to relationship, a between relationship father–son, or a range "It's 50–75 kilometres down the road."
- m-dash — (width of an 'm') Indicates a pause or a break in the sentence, or surrounds a phrase used as an aside, or parenthetical statement. "My father — a loyal husband — is a lawyer.