Is it mandatory to use a comma before a coordinating conjunction uniting the two independent clauses in a compound sentence?
My friend and I had an argument about whether this sentence required a comma:
I understand where you're coming from but I disagree.
My friend insisted that there should be a comma before "but":
I understand where you're coming from, but I disagree.
From my point of view, while grammatically correct, the addition of a comma is not necessary.
When I looked online for sources to answer our disagreement, I found no authoritative sources and many sources were contradicting one another. Some argued, like I believe, that it's not necessary because the addition of comma is of no value in that context (i.e. the addition of comma doesn't make the sentence easier to read) but others said it was mandatory.
So, which is it? Is a comma necessary before a conjunction?
What I was taught in school was that it's acceptable to omit the comma when joining very short independent clauses. What's "short enough" is a judgment call.
I will happily agree with anyone that (a) it doesn't hurt to put the comma in, and (b) whenever the comma definitely makes things clearer, by all means it should be used.
In your particular case, my judgment is that your second independent clause is short enough that you could get away with omitting the comma. (I would include it, though.)
I agree but with reservations.
When it helps make the meaning clear, a comma can't hurt. But it isn't always necessary.
You'll agree with me or you won't.