-
Notifications
You must be signed in to change notification settings - Fork 1
Overview
The notion of "code genre" is taken from Mikhail Bakhtin's small masterpiece "The Problem of Speech Genres". The concept of genre comes from literary studies; examples of literary genres include Greek Tragedy, the Epic, the Petrarchan Sonnet, and Elegy. Less lofty literary genres include the nursery rhyme, the limerick, and the newspaper article.
But the concept of genre extends far beyond such well-known exemplars. Very roughly speaking, a genre is characterized by a set of norms (aka "traditions") governing the form of "instantiations" of the genre. Thus even such humble literary productions as the shopping list, the traffic ticket, and school report card can be viewed as genres. Bakhtin's brilliant essay applied the concept of genre to speech performances of all kinds: not only those with a recognizable genre, such as political speeches and theatrical performances, but even the most mundane and routine speech performances, such as greetings, military commands, and ordering food in a restaurant. In order to be recognized as performances of a certain kind, they must conform to the norms of the genre: a military command that is offered with a whimper and a "please?" would just confuse the troops, since what counts as a command (in the military) is determined by certain syntactic forms (imperative mood, no "please") as well as non-verbal form - a firm tone, etc.
The concept of code genre builds on these notions. The various forms of documentation - the User Guide, the Technical Reference Manual, the Tutorial, etc. - are easily construed as literary genres: their form is governed by a set of norms (conventions, expectations, etc.) that has emerged gradually in the course of the history of computation. Those norms may be relatively loose, but they are norms nonetheless.
But code itself is a kind of literary genre. Programs have certain characteristic forms; these forms are only partially determined by the formal syntax of the language. For example, norms have emerged governing the naming of certain classes of variables; the paradigmatic case is the use if i as the name of an index variable used for looping.