There's been an interesting discussion on swearing in YA literature on one of my listserves. Of course to swear or not to swear is a decision that most young adult writers will come across at one time or another just by the nature of characters they write about. Even if your protagonist doesn't curse, one of the characters in many stories probably will. Some writers have been quite creative about how they handle swearing. For example, John Green in An Abundance of Catherines, used "fuggin" instead of the obvious. In my newest novel, Steps, which is not yet published, my character used "friggin," etc. But, in the novel I'm currently working on, I may need to be more explicit in order to be true to some of the secondary characters. My preference with cursing is similar to my approach to violence in film. So long as it's not gratuitous, I can deal with it. But, sometimes that doesn't work in fiction. What about those teenagers who I pass in the park near my house? The lot of them swear like truck drivers. If I'm painting a realistic picture of teenagers hanging out, it may well involve gratuitous swearing.
Love to hear your take on these things, especially given many of us need to get our books into schools to actually make a living as writers, especially here in Canada. What's a writer to do!