Literary nonsense
Literary nonsense (or nonsense literature) is a broad categorization of literature that balances elements that make sense with some that do not, with the effect of subverting language conventions or logical reasoning.  Even though the most well-known form of literary nonsense is nonsense verse, the genre is present in many forms of literature.

The effect of nonsense is often caused by an excess of meaning, rather than a lack of it. Its humor is derived from its nonsensical nature, rather than wit or the "joke" of a punchline.

History 

Literary nonsense, as recognized since the nineteenth century, comes from a combination of two broad artistic sources. The first and older source is the oral folk tradition, including games, songs, dramas, and rhymes, such as the nursery rhyme Hey Diddle Diddle. The literary figure Mother Goose represents common incarnations of this style of writing.

The second, newer source of literary nonsense is in the intellectual absurdities of court poets, scholars, and intellectuals of various kinds. These writers often created sophisticated nonsense forms of Latin parodies, religious travesties, and political satire, though these texts are distinguished from more pure satire and parody by their exaggerated nonsensical effects.

Today's literary nonsense comes from a combination of both sources. Though not the first to write this hybrid kind of nonsense, Edward Lear developed and popularized it in his many limericks (starting with A Book of Nonsense, 1846) and other famous texts such as The Owl and the Pussycat, The Dong with a Luminous Nose, The Jumblies and The Story of the Four Little Children Who Went Around the World. Lewis Carroll continued this trend, making literary nonsense a worldwide phenomenon with Alice's Adventures in Wonderland (1865) and Through the Looking-Glass (1871). Carroll's poem "Jabberwocky", which appears in the latter book, is often considered quintessential nonsense literature.

Theory

In literary nonsense, certain formal elements of language and logic that facilitate meaning are balanced by elements that negate meaning. These formal elements include semantics, syntax, phonetics, context, representation, and formal diction. The genre is most easily recognizable by the various techniques or devices it uses to create this balance of meaning and lack of meaning, such as faulty cause and effect, portmanteau, neologism, reversals and inversions, imprecision (including gibberish), simultaneity, picture/text incongruity, arbitrariness, infinite repetition, negativity or mirroring, and misappropriation. Nonsense tautology, reduplication, and absurd precision have also been used in the nonsense genre. For a text to be within the genre of literary nonsense, it must have an abundance of nonsense techniques woven into the fabric of the piece. If the text employs only occasional nonsense devices, then it may not be classified as literary nonsense, though there may be a nonsensical effect to certain portions of the work. Laurence Sterne's Tristram Shandy, for instance, employs the nonsense device of imprecision by including a blank page, but this is only one nonsense device in a novel that otherwise makes sense. In Flann O'Brien's The Third Policeman, on the other hand, many of the devices of nonsense are present throughout, and thus it could be considered a nonsense novel.

Distinction

Gibberish, light verse, fantasy, and jokes and riddles are sometimes mistaken for literary nonsense, and the confusion is greater because nonsense can sometimes inhabit these (and many other) forms and genres.

Pure gibberish, as in the "hey diddle diddle" of nursery rhyme, is a device of nonsense, but it does not make a text, overall, literary nonsense. If there is not significant sense to balance out such devices, then the text dissolves into literal (as opposed to literary) nonsense.

Light verse, which is generally speaking humorous verse meant to entertain, may share humor, inconsequentiality, and playfulness, with nonsense, but it usually has a clear point or joke, and does not have the requisite tension between meaning and lack of meaning.

Nonsense is distinct from fantasy, though there are sometimes resemblances between them. While nonsense may employ the strange creatures, other worldly situations, magic, and talking animals of fantasy, these supernatural phenomena are not nonsensical if they have a discernible logic supporting their existence. The distinction lies in the coherent and unified nature of fantasy. Everything follows logic within the rules of the fantasy world; the nonsense world, on the other hand, has no comprehensive system of logic, although it may imply the existence of an inscrutable one, just beyond our grasp. The nature of magic within an imaginary world is an example of this distinction. Fantasy worlds employ the presence of magic to logically explain the impossible. In nonsense literature, magic is rare but when it does occur, its nonsensical nature only adds to the mystery rather than logically explaining anything. An example of nonsensical magic occurs in Carl Sandburg's Rootabaga Stories, when Jason Squiff, in possession of a magical "gold buckskin whincher", has his hat, mittens, and shoes turn into popcorn because, according to the "rules" of the magic, "You have a letter Q in your name and because you have the pleasure and happiness of having a Q in your name you must have a popcorn hat, popcorn mittens and popcorn shoes".

Riddles only appear to be nonsense until the answer is found. The most famous nonsense riddle is only so because it originally had no answer. In Carroll's Alice in Wonderland, the Mad Hatter asks Alice "Why is a raven like a writing-desk?" When Alice gives up, the Hatter replies that he does not know either, creating a nonsensical riddle. Some seemingly nonsense texts are actually riddles, such as the popular 1940s song Mairzy Doats, which at first appears to have little discernible meaning but has a discoverable message. Jokes are not nonsense because their humor comes from their making sense, from our "getting" it, while nonsense is funny because it does not make sense, we do not "get" it.

Audience 

While most contemporary nonsense has been written for children, the form has an extensive history in adult configurations before the nineteenth century. Figures such as John Hoskyns, Henry Peacham, John Sandford, and John Taylor lived in the early seventeenth century and were noted nonsense authors in their time. Nonsense was also an important element in the works of Flann O'Brien and Eugène Ionesco. Literary nonsense, as opposed to the folk forms of nonsense that have always existed in written history, was only first written for children in the early nineteenth century. It was popularized by Edward Lear and then later by Lewis Carroll. Today literary nonsense enjoys a shared audience of adults and children.

Nonsense writers 
Note: None of these writers are considered exclusively a "nonsense writer". Some of them wrote texts considered to be in the genre (as in Lear, Carroll, Gorey, Lennon, Sandburg), while others only use nonsense as an occasional device (as in Joyce, Juster). All of these writers wrote outside of the nonsense genre also.

 Woody Allen
 Douglas Adams
 John Prentiss Benson
 Lewis Carroll
 Ivor Cutler
 Dave Eggers 
 John Flansburgh
 Mike Gordon
 Clark Coolidge
 Edward Gorey
 Eric Idle
 James Joyce
 Norton Juster
 X.J. Kennedy
 Jack Kerouac
 Frank Key
 Rudyard Kipling
 JonArno Lawson
 Edward Lear
 Dennis Lee
 John Lennon
 John Linnell
 Margaret Mahy
 Shaun Micallef
 Spike Milligan
 Kenn Nesbitt
 Flann O'Brien
 Mervyn Peake
 Terry Pratchett
 Jack Prelutsky
 Alastair Reid
 Laura E. Richards
 Theodore Roethke
 Michael Rosen
 Carl Sandburg
 Dr. Seuss
 Jean Shepherd
 Shel Silverstein
 Vivian Stanshall
 Alan Watts

Writers of nonsense from other languages include:

 Alphonse Allais (French)
 Miron Białoszewski (Polish)
 Campos de Carvalho (Brazilian)
 Lennart Hellsing (Swedish)
 Zinken Hopp (Norwegian)
 Eugene Ionesco (French)
 Alfred Jarry (French)
 Frigyes Karinthy (Hungarian)
 Daniil Kharms (Russian)
 Velimir Khlebnikov (Russian)
 Evgeniy Kluev (Russian)
 Alexander Vvedenskiy (Russian)
 Christian Morgenstern (German)
 Halfdan Rasmussen (Danish)
 Sukumar Ray (Indian) Bengali literature
 Gianni Rodari (Italian)
 Erik Satie (French)
 Amos Tutuola (Nigerian)

Popular culture 
Bob Dylan wrote some lyrics that contain nonsense techniques, especially around the mid-1960s, in songs like "Bob Dylan's 115th Dream" and "Tombstone Blues".

David Byrne, frontman of the art rock/new wave group Talking Heads, employed nonsensical techniques in songwriting. Byrne often combined coherent yet unrelated phrases to make up nonsensical lyrics in songs such as: "Burning Down the House", "Making Flippy Floppy" and "Girlfriend Is Better". This tendency formed the basis of the title for the Talking Heads concert movie, Stop Making Sense. More recently, Byrne published Arboretum (2006), a volume of tree-like diagrams that are, "mental maps of imaginary territory".  He continues, explaining the aspect of nonsense: "Irrational logic – [...]. The application of logical scientific rigor and form to basically irrational premises. To proceed, carefully and deliberately, from nonsense, with a straight face, often arriving at a new kind of sense."

Syd Barrett, one-time frontman and founder of Pink Floyd, was known for his often nonsensical songwriting influenced by Lear and Carroll that featured heavily on Pink Floyd's first album, The Piper at the Gates of Dawn.

Glen Baxter's comic work is often nonsense, relying on the baffling interplay between word and image.

Zippy the Pinhead, by Bill Griffith, is an American strip that mixes philosophy, including what has been called "Heideggerian disruptions" and pop culture in its nonsensical processes.