Yesterday brought a Twitterspat in which I engaged, probably unwisely, with a woman who commented that logic governs English grammar and punctuation.
This misconception rises because people become literate and are taught English grammar and stylebook conventions of punctuation, but are never taught the language, that is, the principles of language that linguists have discerned. (Neither was I taught linguistics in school or college, and I've had a great deal of catching up to do.)
Take punctuation. It doesn't require deep thought to see that its conventions are arbitrary. In American English, we put commas and periods inside quotation marks; British English does the opposite. I have seen people indulge in online disputes over which convention is more logical, but you can argue one side and then argue the other side until the cows come home.
Punctuation is more fashion than logic, as you can see in Making a Point, David Crystal's history of English punctuation, or Keith Houston's Shady Characters The Secret Life of Punctuation Symbols & Other Typographical Marks. (Crystal here.)
As to grammar, we know many principles on which it operates, but they too are arbitrary, often accidents of cultural development. Old English collided with Norman French after A.D. 1066, and the Middle English that developed shed most of the inflections of Old English and the gendered nouns of the French. Other languages, though, maintain inflections and gendered nouns; are they more or less logical than English?
We know that the fundamental syntactical pattern in English is subject-verb-object. That isn't necessarily the case elsewhere. We know the order of adjectives, the deep grammar that enables us to talk about the little gray stone church and to see that the stone gray little church isn't right. They are principles, but logic has nothing to do with them. And neither does it seem logical that English should harbor a clutch of words called contranyms, like sanction, which bear opposite meanings.
Places where reliable information about English grammar can be found are Don't Believe a Word by David Shariatmadari and The Joy of Syntax by June Casagrande. (Shariatmadari here; Casagrande here.) Then you will see that logic is useful for argument but irrelevant for grammar.
The person in the Twitterspat was a lawyer who took it ill when I mentioned Samuel Johnson's observation that we are more pained by ignorance than delighted by instruction. I think I deserve some credit for not quoting what Dr. Johnson said about lawyers.