I was thinking about writing a little on dialects, and then lo and behold, Bill Moonroe over at Asimov's board asked me to write about it! So that was perfect timing.
Dialects can be really fun to work with, and they can also be very challenging to work with, depending on how they're approached (especially the real-world ones). It's awesome to find a story where dialect is done really well - gives the whole thing a lot of flavor. But if it's done badly it can be insulting, as I'm sure many of you know.
Here is one useful principle of dialects: since language is constantly changing as it's being used, the longer a population has lived in a given area, the more that pockets of language use in the area will diverge. Some real life populations that come to mind are China, where the dialects are very often mutually unintelligible, Japan, which has a vast variety of dialects, and England. All of these are populations that have been in place for a very long time. In the US we have many dialects that originate from other parts of the world, but it's interesting to observe how many fewer accents there are on the more recently populated West Coast than in the East.
Intercommunication will not eradicate dialects, but it can slow their divergence. This is a useful thing to keep in mind if you're designing a fantasy world, or a SF planet, where the population has been around for a long time.
Dialects also reflect social status. (Don't get me started on social status! Today I have to stick with dialects...) There once was a study done in New York by Labov (earlier I said England, but my visitor Byron kindly reminded me of the real source) where different department stores had slightly different English usage (in pronunciation of "r"), and this was seen as an indicator of status (how classy the store was). So in your world/universe a particular profession, say, mariners or spacefarers, could easily develop their own dialect because they're relatively tight-knit, often isolated, and have a lot of pride in their own community. These regional dialects can simultaneously conflict, and coexist, with "standard" dialect (i.e. without disappearing), because social value is placed on being able to speak to the public, as it were, but a different kind of social value is placed on being able to mark yourself as one of the insiders for any particular language group.
If you want to work with a real-world dialect, there are different ways to approach it. Using alternative spellings of English can be clunky, both to write and to read, if it's not done just right (and for me, sometimes even if it is done right). Fortunately there's a lot more to dialect than just accent (phonetics and phonology, for the linguistics buffs). You can also work with vocabulary, or usages of words that are particular to the dialect. And you can also work with sentence structure, or with rhythm (prosody). Sometimes the easiest approach is to develop a feel for word-flow with a dialect speaker, and then use the surrounding text to imply the accent rather than trying to render it in spelling. In any case, for using real-world dialects the best bet is not to make any guesses. Find yourself a "native speaker" of the dialect and use them to help you grasp its patterns, and if you can, get them to proofread at the end. This is the best kind of insurance against inadvertently making an error that seems to belittle the dialect.
If you're not working with a real-world dialect, you can have a lot more free fun - though I will note that if the dialect appears to resemble a real-world dialect, or has "developed in the future" from one, then you might want to "hang a light on it," or bring attention to the fact that this is a dialect that has progressed on one hundred years since the cockney dialect, etc. so that people won't make wrong guesses.
My last thought would be that it's important to consider the ease with which the reader can grasp the dialect in question. My critique friends will laugh at me for saying this, after all the odd things I've asked them to try to read, but it's true. I just recently designed a language for a short story, but my main concern was less what the language itself sounded like, and more how that language could be rendered comprehensibly in English while still retaining the feel of an alien language. I think my friends would kill me if I actually ever tried to alter spellings, so I always try to go for using sentence structure and rhythmic patterns to indicate the difference. This is because I'm asking them for a real commitment, i.e. to read a whole story in this style. In "Let the Word Take Me" I did a similar thing with the gecko-girl Allayo, which is to say didn't worry much about what her language sounded like, but gave her a different rhythm of speech to contrast with the voice of David Linden.
If you've got one guy who talks funny, that's one thing, but the more extensive the use of dialect is, then the more reader effort it requires. It's worth putting in some effort as a writer to make sure the audience's comfort is being considered.
Because believe me, I don't want to make anyone suffer.