This is a tricky one. I don't like profanity around my kids, but the eldest (coming up 8) knows enough bad words, and can maturely act around the words. The middle child is just expanding on speech so picks these things up very quickly. I try to encourage the oldest one to see that swearing is just an extension of language, used mainly when stupid people have run out of the right words to say, when people are trying to elicit a reaction, or when people are trying to be funny. I am trying to teach her that it's ok, sometimes, to use profanities, in the right context.
This may sound extremely silly, but we also have a game where we try and insult each other, by putting together interesting words and not swearing.
When I was a kid, I lived in Germany, on an Army base. Aged 6 (I can quite clearly remember it), I was playing a game and when I lost, I was told the forfeit was to say something very rude (as I now know it to be), to a cantankerous old German woman who cleaned the officers houses. I did, and she fair beat the crap out of me. Taught me an interesting lesson...
I don't really swear; I am not really often in a situation in which swearing would add value to the situation, but I do understand that it is all about, and you shouldn't really keep it underground with a kid who is bright enough to get it.
I am also teaching her that in other languages, swearing and insulting people is an interesting part of the culture. In the 1960's, we lived in Hong Kong and I still marvel at how Cantonese people speak to each other. Russians have an equally interesting take on insults.
As an aside, my 8 year old is just starting to understand irony properly and, for me, it's a stepping stone to really getting into, really understanding languages. I think profanity is similar in this fact too.