Comedy is an elusive and fast-moving target to define. General public consensus is that humor comes from the unexpected, but this theory is still flawed and doesn't explain everything. One thing's for sure: comedy is funny.
Comedy, as something primarily happy, is directly opposed to Tragedy, and its most modern definition contrasts against yet can overlap with Drama or possibly Horror. And has been since the day it was conceived as a term, albeit not like we know today; comedy was something that either had a happy ending or was written in the common tongue, i.e. Dante's The Divine Comedy, Tragedy was something that had a sad ending. Propelled off of Rule of Funny, comedy infects all art forms. Its hobbies include satires, parodies, pastiches, playing for laughs, snarking, breathless ranting, Irony, and hiding snickerdoodles in its knickerbockers.
A list of UK comedy writer jargon, which includes many familiar tropes, can be found here.