5

For many questions, especially for people introducing themselves as new users of a language, you can usually see in the question some important misunderstanding about how the language works or about programming in general.

While I know that Stack Overflow is basically for Q & A, does it really help to just give a technical piece of code which does what people are asking for, but that we know that they are probably not able to understand it? This is usually what I see in the answers. Shouldn't we rather in these cases just explain the main misunderstanding in the question and redirect to appropriate resources?

You can see an example here: R: Perform multiple if conditions across two data frames of different length using for loop. Answers are given using some libraries, while it is clear from the question that the usage of if statements in R is not understood. In addition, in many such cases, the question is quickly edited afterwards to ask about the next step.

Usually, I'm also tinkling about it when giving an answer: should I give just a working solution or should I also explain what was wrong and how my proposed answer works?

Even if teaching is not the goal of SO, as the proverb says: "Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime".

What do you do usually do in such situations and what would be a good practice?

6
  • The question being edited makes it a chameleon question, and is the hallmark of programming by SO. Those are usually bad questions. But I'm not seeing any edits to change the question on your example.
    – fbueckert
    Commented Aug 23, 2019 at 14:33
  • 9
    Short answer: it depends. When you can explain the fundamental misunderstandings in a question without needing to write a book, then sure go ahead and please do that. It that would require too much text, then keep it basic, we can't teach everything here. "should I give just a working solution or should I also explain what was wrong and how my proposed answer works?", please always the latter. Code-only answers aren't forbidden, but frowned upon.
    – Tom
    Commented Aug 23, 2019 at 14:39
  • 1
    @Tom That'd be a great thing to post as an answer here instead of a comment.
    – TylerH
    Commented Aug 23, 2019 at 15:13
  • 3
    At its core, Stack Overflow is not a place for beginners to come and learn the fundamentals of any language. It is a place for users to come and ask concise and answerable questions about a single topic and receive an answer. If this answer involves the explanation of some fundamentals either as part of the explanation or as an aside and does not go into so much detail that the focus of the answer is shifted away from the focus of the question and, more importantly, the answerer is willing to delve deeper, then I see no issue with this. I've gone into considerable depth on occasion. Commented Aug 23, 2019 at 15:35
  • 2
    If we never taught or explained, the answer to countless questions would be, "No, absolutely don't do that." Commented Aug 23, 2019 at 15:42
  • Thank for your opinions, as @KevinB pointed out, similar discussion already exists (I did not find it before asking)
    – Chelmy88
    Commented Aug 23, 2019 at 15:48

0

Browse other questions tagged .