According to Roland Barthes, all narratives share structural features that each narrative weaves together in different ways. Despite the differences between individual narratives, any narrative employs a limited number of organizational structures (specifically, five of them) that affect our reading of texts. Rather than seeing this situation as limiting, however, Barthes argues that we should take this plurality of codes as an invitation to read a text in such a way as to bring out its multiple meanings and connotations. Rather than reading a text for its linear plot (this happens, then this, then this), rather than being constrained by either genre or even temporal progression, Barthes argues for what he terms a "writerly" rather than a "readerly" approach to texts. According to Barthes, "the writerly text is ourselves writing, before the infinite play of the world (the world as function) is traversed, intersected, stopped, plasticized by some singular system (Ideology, Genus, Criticism) which reduces the plurality of entrances, the opening of networks, the infinity of languages". This closing of the text happens as we read, as you make decisions about a work's genre and its ideological beliefs; however, when you analyze any one sentence of a work closely, it is possible to illustrate just how impacted with meaning (and possibility) any one sentence really is. Barthes exemplifies what he means in S/Z, in which he takes a short story by Honoré de Balzac (Sarrasine) and analyzes each individual sentence for its relation to five master codes.
The five codes are as follows:
The hermeneutic code (HER.) refers to any element in a story that is not explained and, therefore, exists as an enigma for the reader, raising questions that demand explication. Most stories hold details in order to increase the effect of the final revelation of all diegetic truths. We tend not to be satisfied by a narrative unless all "loose ends" are tied; however, narratives often frustrate the early revelation of truths, offering the reader what Barthes terms "snares" (deliberate evasions of the truth), "equivocations" (mixtures of truth and snare), "partial answers," "suspended answers," and "jammings" (acknowledgments of insolubility). As Barthes explains, "The variety of these terms (their inventive range) attests to the considerable labor the discourse must accomplish if it hopes to arrest the enigma, to keep it open". The best example may well be the genre of the detective story. The entire narrative of such a story operates primarily by the hermeneutic code. We witness a murder and the rest of the narrative is devoted to determining the questions that are raised by the initial scene of violence. The detective spends the story reading the clues that, only at the end, reconstructs the story of the murder.
The proairetic code (ACT.) refers to the other major structuring principle that builds interest or suspense on the part of a reader or viewer. The proairetic code applies to any action that implies a further narrative action. For example, a gunslinger draws his gun on an adversary and we wonder what the resolution of this action will be. We wait to see if he kills his opponent or is wounded himself. Suspense is thus created by action rather than by a reader's or a viewer's wish to have mysteries explained.
These first two codes tend to be aligned with temporal order and thus require, for full effect, that we read a book or view a film temporally from beginning to end. Barthes at one point aligns these two codes with "the same tonal determination that melody and harmony have in classical music". A traditional, "readerly" text tends to be especially "dependent on [these] two sequential codes: the revelation of truth and the coordination of the actions represented: there is the same constraint in the gradual order of melody and in the equally gradual order of the narrative sequence". The next three codes tend to work "outside the constraints of time" and are, therefore, more properly reversible, which is to say that there is no necessary reason to read the instances of these codes in chronological order to make sense of them in the narrative.
The semantic code (SEM.) points to any element in a text that suggests a particular, often additional meaning by way of connotation. In the first lexia that I quote above from Barthes' S/Z, "Sarrasine" is associated with "femininity" because of the word's feminine form (as opposed to the masculine form, "Sarrazin"). The question of femininity later becomes an important one in Balzac's story about a man's love for a castrato that he, at first, believes to be a woman. By "connotation," Barthes does not mean a free-form association of ideas (where anything goes) but "a correlation immanent in the text, in the texts; or again, one may say that it is an association made by the text-as-subject within its own system". In other words, Barthes marks out those semantic connotations that have special meaning for the work at hand.
The symbolic code (SYM.) can be difficult to distinguish from the semantic code and Barthes is not always clear on the distinction between these two codes; the easiest way to think of the symbolic code is as a "deeper" structural principle that organizes semantic meanings, usually by way of antitheses or by way of mediations (particularly, forbiddend mediations) between antithetical terms. The concept is perhaps most analogous to Algirdas Greimas' understanding of antagonism and contradiction in narrative structure. A symbolic antithesis often marks a barrier for the text. As Barthes writes, "Every joining of two antithetical terms, every mixture, every conciliationin short, every passage through the wall of the Antithesisthus constitutes a transgression."
The cultural code (REF.) designates any element in a narrative that refers "to a science or a body of knowledge". In other words, the cultural codes tend to point to our shared knowledge about the way the world works, including properties that we can designate as "physical, physiological, medical, psychological, literary, historical, etc." The "gnomic" code is one of the cultural codes and refers to those cultural codes that are tied to clichés, proverbs, or popular sayings of various sorts.
Together, these five codes function like a "weaving of voices," as Barthes puts it . The codes point to the "multivalence of the text" and to "its partial reversibility", allowing a reader to see a work not just as a single narrative line but as a contellation or braiding of meanings: "The grouping of codes, as they enter into the work, into the movement of the reading, constitute a braid (text, fabric, braid: the same thing); each thread, each code, is a voice; these braidedor braidingvoices form the writing".