IMHO a one line answer that is not backed up by references and doesn't show significant research efforts doesn't fit to P.SE. An example (no offense to Thorbjørn who is actually one of the best contributors): How would you know if you've written readable and easily maintainable code?. Peer code reviews is indeed one of the best ways but this answer doesn't explain why, doesn't give any references, etc. It seems like the contributor didn't have the time to work on the answer. In that case I think that a comment would be more appropriate. Am I right or I'm missing something here?
I think that you are partially correct.
A one line answer without any demonstration of experiences or citations of references isn't an example of a great answer. I wouldn't go so far as to say it doesn't fit the site, but it would be something to look at. A short answer that doesn't share experiences or references could be a bad answer, or it could be indicative of a bad question that doesn't elicit the need to share experiences or references.
However, no answer should be posted as a comment, even if it is short enough. Comments are for asking clarification or providing additional information, not providing answers.
This MSO discussion sums it up well:
Of course, obviously the better answers will generally be longer than one line. To bulk up the content, you might consider doing things like:
- linking to the appropriate documentation
- including a code sample
- suggesting a superior alternative approach
- cautioning against some things that people in the same situation commonly do wrong
- adding superfluous bulleted lists
There are many good answers that can be written in one sentence. However, the best answers explain the reasoning behind that one line. They explain the thought process that is required to arrive at the correct decision. They may include a personal experience that supports the conclusion reached. I've seen some good answers that take the approach the OP originally thought of and show how it leads to failure, and then present a better solution.
The best defense against harmful one-liners, as with many things on SE, is your voting powers. Don't be afraid to downvote the one-liners!
Judge an answer by it's quality and correctness, not it's length.
Downvote it if the quality is below an acceptable standard, or the answer is incorrect, but don't discriminate against answers just because of their length.
Also don't forget, you can always leave a comment requesting the user expand their one-line answer into a more detailed response that covers the hows and the whys of the situation. I find many users are quite willing to do this if asked, and it will probably lead to them writing better quality answers in the future.
Note: I only found this discussion accidentally.
I find it interesting that you consider my answer to be an example of "...a one line answer that is not backed up by references and doesn't show significant research efforts..", and I believe this is not so.
Perhaps the misunderstanding is that you would like explicit mentioning of all the references and all the research effort in the answer.
In this particular case it is simply not necessary. The laconic style is intentional since lots of wording will just muddle the point being made, namely that you as the author of the code cannot tell, and the computer being a victim of the halting problem cannot either. You MUST ask another human (or yourself when you have forgotten sufficiently of what you knew when you wrote it). I believe the number of upvotes reflect that other programmers have enough experience to recognize this too.
So, in this case a one-liner is the most precise way of mentoring the asker.
Your example looks like an awesome answer to me.
- How would you know if you've written readable and easily maintainable code?
- Your peer tells you after reviewing the code.
Not only does it answer the question, it also introduces important notions of peers, code review and feedback, ties them together and presents in a way that is easy to understand and use.
Answer style is not quite typical, in the sense that most other good answers I've seen at Programmers tend to be more verbose. But since stylistic consistency is not the only criteria I use, this doesn't worry me.
For the sake of completeness need to note that this particular one-liner is pretty exceptional; vast majority of other one-liners I deal with at P.SE are not like that - easy targets for downvote, flag or "expanding edit".
The question is: Should we expect from the readers to infer the needed context?
Good question. My take is
- in more typical cases it's better to just err on safe side and provide context explicitly
Mainly because expanding average one-liner does no harm.
- in this particular case - yes, it looks reasonable to expect that from a reader
Because expanding high quality one-liner could do more harm than good.
To avoid misunderstanding, I would like to make it perfectly clear that I support general guidelines you referred to. I believe that one-liners are typically not a good fit for Programmers. I also think that providing explicit answer context is as a rule beneficial for the answer quality.
The fact that I may occasionally encounter particular exceptional case (like it was with your example answer) won't stop me from following these guidelines.
I'd argue that an one-line-answer with many upvotes is an indication of a bad question. An answer that doesn't need citations, explanations or references to be deemed correct is most likely either an obvious answer ("yes, a compiler compiles") or a highly subjective/religious answer ("Linux is better"). Good questions do not provoke such answers, at least not with that many upvotes.