What to KnowDidactic generally means "designed to teach people something," but is often used derisively to describe boring or annoying lessons, or the people who teach them. While didactic can have a neutral meaning, pedantic is almost always an insult, referring to someone who is annoying for their attention to minor detail, or for their snobbish expertise in a narrow or boring topic.
Didactic Meaning: Sometimes an Insult
Didactic and pedantic: they're both connected to teaching, but teachers will likely object to being described with either one.
Didactic can have a neutral meaning of "designed or intended to teach people something," but often didactic is used when the lesson being taught is annoying or unwanted—such as an attempt to school people on what's proper or moral.
Describing a person as "didactic" is almost never a compliment; describing something written or made by a person usually isn't either. In educational settings, though, didactic can describe a kind of instruction that involves lectures and textbooks only, as opposed to laboratory or clinical work. Or it can be applied in technical contexts dealing with theories of teaching. It can also describe literature or art that is meant to instruct as well as to entertain and please, such as didactic poetry. These meanings do not carry negative connotations.
Pedantic Meaning: Almost Always an Insult
Pedantic is used more narrowly. It typically describes a particular kind of annoying person. You know the sort: the person who tends to correct small errors other people make and who pays way too much attention to minor details. Or the person who's an expert in some narrow, boring topic—and makes sure everyone else know the extent of that expertise.
Pedantic comes from the noun pedant, which originally wasn't a bad thing to be: a pedant was a household tutor or a schoolteacher. But the adjective pedantic seems to have been even from its 17th century beginnings something that not even a 17th century pedant would want to be. Pedant itself took on negative connotations soon after it was first used in the late 16th century, and it mostly keeps those negative connotations today. The "tutor" meaning is long gone; when pedant is not referring to someone who's pedantic, it refers to a teacher who highly values rules and precision.