I think using profanity sparingly and carefully in a book can be VERY effective to set a mood or convey a situation. No spoiler here, but anyone who is a fan of Lois McMaster Bujold knows that she manages to write engaging and thrilling stories over and over without the use of profanity (at least for the most part.) However, the latest novel about Miles (Cryoburn) has a passage in it that tears your heart out, solely because of the profanity. In that case it is used to convey very strong emotion, and it would be a lesser book without it. (In my opinion, anyway.

)