A defining characteristic of hard-boiled detective fiction is cynicism. The protagonist in such a novel has a necessarily cynical world view and makes cynical observations about the world. Many such novels are set in Los Angeles. I thought that was just a cliché trope, until I started thinking about how the setting contributes to the story’s cynicism.
The culture of 1940’s Los Angeles promotes cynicism in two ways that I can think of off the top of my head. First, corruption among all levels of law enforcement was very high. A private detective investigating crime inevitably interacts with the police and prosecutors, and in a corrupt town like L.A. they serve as good obstacles and antagonists. A police detective may himself be corrupt, or may be the rare good cop trying to navigate a corrupt system. Secondly, the Hollywood filmmaking industry has a dark side, using up and taking advantage of a constant flow of naive, aspiring actors. There are so many systems set up for personal gain, the city is one big trap.
I am currently reading two series of hard-boiled detective fiction set elsewhere. One is Martin Cruz Smith’s series of novels centering on Arkady Renko, beginning with Gorky Park. It is set in the Soviet Union, dating (so far) near the end of the Soviet era. What could be more corrupt than that? Cynicism is also aided by the ideals of Communism, Marxism, and Leninism, which by this point in history few people believe in, but must still go through the motions. The KGB and the militia (the domestic police force) are not so corrupt as they are serving interests in conflict with direct criminal law enforcement, and Soviet citizens live a dual life to keep up public appearances. These novels are a lens through which to examine how human nature undermined and defeated Marxism, as well as the brutality by which individuals will treat each other under such an authoritarian system.
The other is Philip Kerr’s Bernie Gunther novels, which are set in and around Berlin during the period leading up to and after World War II. In the 1930’s, Berlin is a city of immorality with a corrupt and ineffective police force. However, the politics of the 1930’s rapidly leads the culture to disconnect with reality, breeding hate and opportunism. During the war itself, there is a period of apparent success gained at the expense of others, followed by a doom and impending judgement that everyone can sense. Following the war is a period of poverty and the corruption that it brings, combined with a sort of cultural retribution by the Allies. Again, the authoritarianism and the dark ways in which human nature responds to it.
I suppose it may be possible to write cynicism in a setting that is optimistic and ideal. However, it certainly helps, when writing hard-boiled fiction, to have a setting that focuses and emphasizes dark human nature.