It distresses me to say this, because she's one of my favourite authors, but I'm going to do it anyway: I disagree with Anne Fine. The former children's laureate thinks that "realism has gone too far in literature for children", and that the depressing endings of the books of today "do little to inspire".

Now, Fine has long been against the more extreme end of children's writing, saying that "all of the publishers who have touched this novel should be deeply ashamed of themselves" of Melvin Burgess's Doing It, and more recently asking of Margo Lanagan's Tender Morsels "whether a children's publisher does not sometimes have a responsibility to stop and say that although a shocking new book will make money, and even be popular, it does not have what the Americans call 'redeeming social importance'".

While I have a feeling that her comments at the Edinburgh international book festival have been blown a little out of proportion – she's not advocating a return to "the sort of fiction that is no longer credible – books with a Blyton-ish view of things" – some of the best modern children's books I've read recently have been the most realistic, dealing with tough issues, from knife crime to death. Patrick Ness's The Knife of Never Letting Go sees its protagonist grappling with the reality of stabbing someone to death. Gritty, dirty and upsetting, there's no glamour here: "And I punch the knife into his chest. It crunches as it goes in, turning to the side as it hits a bone and I pull back my arm and I stab him again."

Jenny Downham's Before I Die, the story of a teenage girl dying of cancer, had me crying on the tube – it's not even remotely sentimental, though: Tessa wants to experience everything life has to offer before she dies, from sex to drugs. Siobhan Dowd's Solace of the Road, about a runaway teenage foster child desperate for love, is heartbreakingly poignant, but definitely realistic. And I read Tender Morsels last week and was blown away by it: a retelling of the Snow White and Rose Red fairytale, dealing – obliquely, not explicitly, with incest and rape – I thought it was brilliant, a dreamy, surreal, Angela Carter-esque take on the story. Meg Rosoff puts it far better than I could.

These books are aimed at the young adult market. Some readers will be aware of the issues these books are dealing with, in which case, reading about them in fiction will be a way of understanding them, coming to terms with them, doing something about them. Some will not – but books are there to educate about the world, to explain difficult issues, to widen understanding.

The books I read and loved when I was a child were often the ones that troubled and disturbed me, while opening my eyes to a world I didn't know and kick-starting my imagination. Robert C O'Brien's Z For Zachariah is incredibly bleak, set after a nuclear holocaust, where a male survivor attempts to force a young girl to marry him. Even the ending is uncertain – Ann sets off into the nuclear wasteland with no particular hope of finding other life. And going younger still, how about Charlotte's Web (tears for days)? Watership Down (had to be hidden at the top of the cupboard)? Any of Roald Dahl?

Children's fiction needs to engage with the issues that concern and worry its readers, otherwise it becomes irrelevant to them. Sure, there's a need for happy endings and jolly jaunts, but there is also a need to address the darker side of life.

Anyway, the reason I don't feel too bad about disagreeing with Fine is that she herself isn't one to shy away from realism. Step By Wicked Step, about the difficulties of step-families, is excellent; The Road ofBones, about a totalitarian state, ditto. And as for Madame Doubtfire and its cross-dressing dad … well. It's a far cry from being Blyton-esque, that's for sure.