Following up on this question (and its answers), I was recently confronted with one of Stephane's answers in the LQPRQ. I commented that he should know better, he responded that awk code is self-explanatory and no further explanation is necessary. In some sense there is a point, as: what else should there be? - The answers solves the question. However, not everyone speaks awk as fluently as him, so the whole issue of code-only answers is still bothering me.

Moreover, once in a while I come across other users' code-only answers in the LQPRQ, and my (preliminary) take on those is that they "Look OK", where I leave to the users to judge whether the solution works or not.

Yet, I am not certain whether this is the right thing to do (bearing in mind the question what else should there be if the code answers the question?).

Is there a more precise guideline for such cases? How do sites like SuperUser or StackOverflow handle this?


1 Answer 1


If you feel an answer isn't good, feel free to downvote it. That it was written by a high-rep user is irrelevant. Personally, I agree that an answer which is just code is rarely useful and some explanation is always helpful. On the other hand, I also understand that for very simple things, the explanation would have to explain the most basic syntax of the language/tool used.

So, while I tend to try and explain even things like "awk reads your file line by line, splitting into fields which are then available as $1, $2 ... $N", I can understand why someone would say that that is too simple. And yes, a code-only answer that works and does what was asked for is better than no answer.

However, an answer that provides both code and guidance is always to be preferred. As for the specific user you mention, he has been known to explain his answers. When he feels it necessary, he can even provide small essays. So I wouldn't call it a general problem. He just seems to feel that some things are self explanatory. And they are, as long as you are passingly familiar with awk anyway.

As I said in the beginning, however, if you feel it isn't a good answer, downvote it! Don't be afraid to downvote high rep, knowledgeable users when their answers deserve it. Nobody's perfect (and they won't know it was you anyway ;) ). Alternatively, and preferably, leave them a comment asking for an explanation. They might comply. Finally, if you're feeling particularly helpful, edit the answer and add the explanation yourself.

You must log in to answer this question.

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