What exactly is swearing? When you think about it, all language is learned from our parents and those around us by hearing it, and then using it. So if we hear a foul-mouthed five-year-old we have to wonder what the language is like in that child's home. So what makes a swear word a swear word. Well simply put it has to be in the eye of the beholder, or rather the ear of the listener. In other words, it is a matter of opinion.
Does that give us licence to use profanity whenever we wish? No. Simply because good manners cause us to consider how what we say will be viewed by anyone listening - or reading. We need to ask, will the reader, or listener be offended? Often what will be considered a swear word in one part of Britain, will be viewed as innocuous elsewhere. And what is commonplace in America may be viewed badly in England.
When writing, therefore, we need to consider the audience. True, a character may be under extreme provocation, and it would be ridiculous to have them saying: 'Oh, golly gosh!' But a writer skilled with words ought to be able to find ways of expressing anger, or hurt to get the message across without necessarily offending the reader. And of course, one has to consider the genre. In a gritty, warts and all story, the reader may expect a few expletives, in which case, one assumes the reader will not necessarily be a maiden aunt!
Of course history affects what is bad language. Writers of historical fiction would find it helpful to consult a dictionary on historical slang. The F word, for example, dates from around late 19th century or early 20th century, so one would not include it in a book set in, say, the 18th century, such as in Gentleman of Fortune, even if one is dealing with ruthless pirates. It would not be historically accurate. It is a matter of doing one's research. Happily, I found that eighteenth century swearing is often considered innocuous by today's standards, so one can get the message across without resorting to offensive language.
And while we are on the subject of offensive language, what about blasphemy. It is so commonplace now to say 'Oh God!' or 'Oh my God', often shortened to omg. and even avowed atheists say it! In actual fact it is a meaningless phrase, meant to convey surprise, or shock etc., and it can offend some readers. In history, looking at the phrases people used then, God comes into it a great deal. Examples may be ''struth', or ''sblood', which mean 'God's truth' or 'God's blood' respectively. There are many others, so the writer would be wise to research first. Even if you do not know what a phrase means, your reader might!
As writers, we do not want to offend our readers. If we are certain that in the genre in which we are writing our reader will not be offended, then we do as conscience dictates.
Personally, I do not like bad language at all. I do not like to see it on Twitter, or Facebook. And there are others like me.
And that is my opinion.