This is something that I've noticed is especially prevalent on SQL-related questions but applies to any kind of code question. I'll see a new user, and their question illustrates that they're new to the subject. They'll ask a question that has perhaps several valid answers, and most of the answers they get are just SQL, nothing else, not even a comment. This seems a bit much when the answer contains code which would be several levels up from what the new user is familiar with.

Would it not be better, if a user is clearly new to the subject, not to bombard them with the more complex syntax without explanation? Otherwise I feel we're just encouraging people to copy-and-paste code without understanding it.
Or is it better to treat the audience as wider than just the person asking the question, and assume that others will learn more from the answer?

Feel free to point me at the duplicate I'm sure this question has, but I couldn't find one...

share|improve this question
add comment

4 Answers

up vote 10 down vote accepted

If you see two answers, one is just a code dump, and the other is an equivalent piece of code with an accompanying explanation, just upvote the one you think is more helpful.

share|improve this answer
    
Answers with explanation are so juicy and better off for people in the long run wanting to know why something is or why it works like that. –  random Oct 14 '09 at 1:22
    
Some answers must look to newbies like showing off...I bet a fair number never return because the first answer terrified them. –  CodeByMoonlight Oct 14 '09 at 22:53
add comment

Would it not be better, if a user is clearly new to the subject, not to bombard them with the more complex syntax without explanation?

Yes.

Or is it better to treat the audience as wider than just the person asking the question, and assume that others will learn more from the answer?

No reason to assume that future readers won't be equally confused by a raw SQL dump... Explain away.

share|improve this answer
add comment

Generally, a detailed explanation hurts you when it comes to earning rep (unless you are just REALLY fast at explaining, or the topic has low traffic).

I've been bitten by this a bunch of times: I see a question with no responses, I start typing up an answer with a lot of explanation and details. By the time I finish, there are a few quickie "code only" answers that have upvotes already, and at that point I'll be lucky to get anything for the effort.

So, that's just my theory on why it's common to see the short "code only" answers.

Best way to handle this, in my view, is to post the short answer first, then start editing right away and improve with details and explanations. This allows you to get your answer out there quickly, and it also promotes good answers. I've found that adding explanations and details is generally a surefire way to "break ties" and have your answer move to the #1 slot.

Oh, and another minor detail: it helps people learn stuff too :)

share|improve this answer
1  
"...post the short answer first, then start editing...": and you can add a not to the quick short answer stating something like 'Explanation to follow' (or something similar). –  akf Oct 13 '09 at 17:43
    
I couldn't agree more if there were 10 of me. Another thing I've been hit by is being downmodded or contradicted because I didn't choose to explain as if I was explaining to an expert. –  user137234 Oct 13 '09 at 20:30
    
I've also seen some huge code-only answers floating around - scary things. –  CodeByMoonlight Oct 14 '09 at 22:52
add comment

If there is a straightforward code answer, I tend to post that first (after checking that it works with any sample data provided -- if that costs me votes, so be it). Then, I revise/clarify my answer. Sometimes, I end up editing quite a few times and my answer becomes CW, but I can live with that.

I like being the first to post an answer (and I like my Enlightened badges ;-).

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .