P.D. James neatly refutes the dismissal of detective stories as "mere formula writing" as follows in her new book, Talking About Detective Fiction:
One of the criticisms of the detective story is that this imposed pattern is mere formula writing, that it binds the novelist in a straitjacket which is inimical to the artistic freedom which is essential to creativity and that subtlety of characterization, a setting which comes alive for the reader and even credibility are sacrificed to the dominance of structure and plot. But what I find fascinating is the extraordinary variety of books and writers which this so-called formula has been able to accommodate, and how many authors have found the constraints and conventions of the detective story liberating rather than inhibiting of their creative imagination. To say that one cannot produce a good novel within the discipline of a formal structure is as foolish as to say that no sonnet can be great poetry since a sonnet is restricted to fourteen lines⎯an octave and a sestet⎯and a strict rhyming sequence.
James explores that extraordinary variety through the rest of the book which is essentially an idiosyncratic history of detective fiction with occasional musings about her own writing process thrown in. It makes for most interesting reading for devotees of crime fiction.