When you want to connect two closely related sentences, you can use a semicolon or a dash. (You can also use a dash for other kinds of non-sentential relations). How would you choose whether to use a semicolon or dash?
Punctuation – Using Semicolon or Dash to Connect Sentences
dashespunctuationsemicolon
Related Solutions
Dashes can be used in place of parentheses to indicate an aside or qualifying statement. I don't think either has a place in any of your examples.
Generally speaking, for the same reason you're having a hard time understanding their use, it's a good idea to avoid using semicolons altogether. The semicolon is intended to separate two sentences where the second sentence clarifies or extends the first. In practice, they're often used incorrectly and there is ample evidence that they confuse readers and translation software. A comma or period would often suffice.
It's good advice to use the simplest punctuation possible. That often means using the simplest sentence construction possible as well. Here is how I would punctuate your examples:
English is not my first language. I'm having trouble understanding the punctuation, specifically semicolons and dashes.
Note here that the wording is more specific so that the second clause merely clarifies. It could be thought of as a contraction of this more verbose version:
English is not my first language. I'm having trouble understanding the punctuation. Specifically, I'm having trouble understanding semicolons and dashes.
Or, if you really felt the need to use that spare semicolon:
English is not my first language. I'm having trouble understanding the punctuation; specifically, I'm having trouble understanding semicolons and dashes.
Your second example is fine as is; it's completely clear in meaning as two sentences (see what I did there?).
Your third sentence provides a great example of the many ways to associate two sentences. The first is very clear, but awkward and wordy. The second is probably most confusing to readers because the second sentence is quasi-grammatical. "it" implies "The question" here. The third is a rather elegant construction to my native English comprehension. Does the conjunction "but" imply the same meaning to you, however?
The question isn't what you can take away from this. The question is what you can learn in the process.
The question isn't what you can take away from this; it is what you can learn in the process.
The question isn't what you can take away from this, but what you can learn in the process.
These all mean exactly the same thing. From your perspective, take the construction that makes the most sense and use that consistently in your writing. Much great writing can be done without any semicolons at all.
Finally, note that your last example is a rhetorically loaded construction in English. I'm sure "Not this, but that" phrasings are encountered in many languages. Here's a famous example:
Ask not what your country can do for you. Ask what you can do for your country.
In these cases, simple, repeated, parallel constructions work in your favor in spite of the punctuation:
It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness...
Be clear. Be consistent. Remember that many writers don't actually know the rules of punctuation. My apologies for rambling.
Your second example is the correct way to express the concepts in your sentences using commas.
The use of dashes would not be appropriate in these circumstances. You mention joining and thoughts. The connection of equally weighted concepts is not usually joined with dashes, and if punctuation is needed, it is usually commas or semicolons.
Dashes are usually used within a sentence to indicate a side thought, often called a parenthetical phrase, because it could also be put inside of parentheses. An example would be
An S database - the most versatile of storage systems - allows access from,and can be opened by, multiple applications at the same time.
The commas are needed in your sentence because the verb phrases allows access from and can be opened by use different prepositions. If there were no prepositions, you could use and without the commas, such as
An S database can access and open multiple applications at the same time
Best Answer
I don't think I was ever taught a clear-cut rule, and as a non-native speaker, I am probably spoiled to some extent by the usage of dashes in other languages. That being said, following nothing but my intuition I would use:
I will try to demonstrate my point by rewording the notorious examples from The Oatmeal accordingly.
Again, this is just my two cents, and I'm only putting them in because the other answers so far seem to miss the point of your question by focusing on non-sentential relations and sometimes not even mentioning semicolons at all. I don't know whether my answer comes close to being correct or not, but I hope it will at least serve as a turning point for getting the discussion back on topic.