Isn't this what in linguistics people call 'code-switching'? It's a contextual and cultural thing. Just like when people go into formal settings like an interview for a white collar job, they tone down the swearing --but ight turn it up once they meet with colleagues at a bar.