Most writers learn quickly that when we refer to the English language, we’re really talking about a group of micro-languages, or dialects, which are so similar that a speaker of one can easily understand the speaker of another. Dialects are differentiated from each others by a variety of markers. Highly important among these markers (at least for writers of fiction) is slang.
Slang can do a remarkable amount of work when it comes to establishing the time and place of your novel. Terms like “Doll-dizzy” and “Killer diller” are as essential to the fabric of a 1940s US setting as bebop records and wartime propaganda. These informal expressions help the reader feel at home in a historical setting. They can also be used to add a modern touch to a story set in the present day, but be warned: in a few years, they will date your narrative and may jar the reader.
Slang can also help you build your characters. While nearly everybody uses slang to some extent, more educated characters (particularly in historical settings) will prefer to use more formal, ‘correct’ language. Moreover, characters from different backgrounds will use different kinds of slang. For example, a sailor during the Napoleonic Wars would have a rather rich slang vocabulary that is distinct from other slang of that era.
There are situations, of course, when you want to avoid the use of slang. Formal and technical writing are obvious areas, and some writers (such as myself) prefer to even keep it out of the narrator’s lines in fiction. You also want to steer clear of slang where it would make your characters seem stereotyped, and you never want to overuse it to the point where your writing becomes impenetrably gimmicky. However, a little informal expression here and there can help you make your settings and characters more rich, varied, and believable to your readers.