Writing can be a vague and subjective subject, and it's not always easy to see what makes a "good" Stack Exchange answer, compared to a "less good" one.
What guidelines will help me write better answers on Writers.SE?
The quality of an answer can be measured in three aspects: content, style/tone, and formatting. Generally, content is the most important and style/tone is more important than formatting; but extremely bad formatting can make an otherwise good answer too difficult to read. An offensive tone can likewise keep an answer from being read. Obviously, an unread answer is not helpful.
An excellent answer will excel in all three aspects.
The goal is to provide a well-supported (preferably sourced) answer that (a) offers a conclusion (an actual answer) and (b) shows why it is correct.
Answer the question actually asked. (Source: Lauren Ipsum)
Include relevant quotes from references rather than just a link. Aside from issues of link rot, forcing the reader to follow links to reach the answer is less helpful. An answer should be complete on its own.
Do not simply post your opinion; show your reasoning. (Source: Monica Cellio) Not only does this allow the community to evaluate the validity of the answer (which incidentally will encourage readers to upvote the answer), but it can also help the original asker recognize how appropriate the answer is to the particular problem (which may not have been precisely communicated) and can help readers answer other similar questions.
Provide links rather than just citation information when possible. Making the reader work harder than necessary to access additional information or confirm the accuracy of a reference is not helpful. When recommending a book, linking to a book seller is acceptable and can be helpful. Links to amazon.com will be converted to use Stack Exchange's affiliate program (as suggested here), so providing amazon.com links may help fund Stack Exchange.
Provide a sufficient but not necessarily exhaustive answer. For some questions, even a book might not be long enough to provide a complete answer. Providing links or references to additional resources can be helpful for addressing such complex questions.
Unlike many sites, Stack Exchange sites are not looking for opinions and discussion. Answers should be focused and open to independent evaluation of the evidence provided.
Stack Exchange sites are dynamic and collaborative. An answer might go through several revisions. This is normal. Do not be afraid to edit an answer. If others edit your answer, understand that they are trying to help.
One reason an answer might be edited is in response to comments. What seemed clear to you might not be clear to readers, so if somebody asks for clarification, edit your answer in response. (The answer, not a followup comment, is the right place to respond.) If a comment expresses disagreement, it may be appropriate to clarify what is being stated or to strengthen the supporting arguments. Sometimes disagreement is unavoidable, but often it indicates a misunderstanding or a perception of an unsubstantiated belief.
Do not be afraid to incorporate content from comments (or even—to a some extent—other answers) into the answer. (Question: How should such be cited? "as X noted in a [comment]" might be good.) On Stack Exchange, user contributions are licensed under cc-wiki with attribution required. [The etiquette for using others content should be specified, especially with respect to taking from other answers. Having fewer, more complete answers is better, but even with a linked citation inclusion of others content will likely keep the other answerer from receiving earned reputation and feel like theft.]
Use a polite, professional tone, in particular avoid sarcasm. (Lauren Ipsum) The primary purpose of an answer is to teach, not to show how cleverly one can mock others.
Be concise but not cryptic. If an answer is necessarily long, providing an overview at the beginning is helpful even when such increases the total length. If a long answer cannot be easily summarized (e.g., list answers), avoid an extensive introduction.
Provide examples when appropriate. Concrete examples can greatly clarify an answer.
Place less critical information near the end of the answer. If such information is particularly significant in an earlier portion of the answer (e.g., a noteworthy exception that requires significant explanation), indicate that additional, significant content is presented later—e.g., "(one exception is explained near the end of this answer)".
Prefer the use of internationally accessible language. English is not the native language of some readers and, even among native speakers, dialect (or cultural) differences can make some words or phrases more difficult to understand. While some localization of language is unavoidable, an awareness of the readership is important.
Do not end your answer with a signature. Information that would be placed in a signature can be included in your profile page. A link to this page is automatically provided at the end of each post.
Question: How much should "I hope this helps" endings be discouraged? (This is similar to "Thanks in advance" endings for questions—which I seem to recall are mildly discouraged. Ideally, politeness and any lack of confidence in the answer would be communicated in the body of the answer, but such endings seem to only be mildly bloating since they do communicate some relevant information [and the meta-information of politeness].)
Question: How much should informal (and excessively formal) diction be discouraged? Some informality seems to improve readability (perhaps especially for non-native speakers) and the pleasure of reading (avoiding textbook/lecture dullness), but a more professional tone would tend to avoid such things as frequent contractions (obviously excluding writing samples or examples). [I tend to err on the side of excess formality as a social barrier, so my judgment is not trustworthy.]
Provide breaks using punctuation and paragraph spacing. (Source: Lauren Ipsum again) Run-on paragraphs, like run-on sentences, can be difficult to read.
Use block quoting for long quotes, sample text for criticism, and example text. This can be done by beginning a line with a greater-than sign (>). For poetry with varying indentation, preformatted text can be used by placing four spaces at the start of each line. Line breaks can be indicated by ending a line with two spaces.
When appropriate use emphasis (italic). This can be done by placing an underscore or an asterisk at the start and end of the emphasized text.
Sometimes strong emphasis (bold) is appropriate. When a longer quote is necessary to provide context, strong emphasis of the most relevant parts may be helpful; lighter emphasis is more likely not to be recognized when rapidly reading a longer quote.
For long answers, using section headers can be help clarify the division of the content. (Source: Lauren Ipsum) A header can be indicated by starting the line with the header text with the number of hash marks (#) equal to the level of the header. Alternatively, a primary (level one) header can be indicated by starting the line immediately under the header text with an equal sign (=); similarly, a level two header can be indicated with a hyphen (-).
Question: How should a line rule be used? I think it might be appropriate for separating less critical content near the end of an answer (when using a header might add undue emphasis).
Since answers on Stack Exchange are short reference material not textbook narrative, formatting that would be jarring in a longer text may be preferred.
For further help with using the mark-up language at Stack Exchange, an overview is available.
Overall, when answering a question try to be helpful, first to the original asker, but also to other readers.
To Lauren's list I would add: show your reasoning. Our site is naturally going to attract subjective questions. Good Subjective, Bad Subjective is oriented more toward questions than answers, but the same principles apply: opinions, on their own, are not valuable (especially when no one knows who you are), but positions supported by documented facts, logic, or personal experience that you explain are.
In other words, don't just tell us "the answer" (or an answer); show us why it's appropriate.
Answer the question actually asked.
Be pleasant. Or at least be civil. Your sarcasm isn't as funny as you think it is. ← guilty as charged
If you run long, use headlines and paragraph breaks.
If you post a link, describe it and include some content from the link in case it goes bad someday.
If applicable, include examples. Anecdotes can be really helpful in illustrating a particular point.