11

Following the meta post Is asking for an explanation of some code on-topic?, I learned that asking for explanation of code can be on-topic.

Now I came across the question Obscure but short batch file to remove duplicate lines from .txt file, where the poster is asking for an explanation of the code of an answer to another question.

At the moment I provided a short answer in a comment and also mentioned that they could have posted a comment to the answer where the code is taken from, requesting clarification.

However, how should such questions be treated in general (supposing they are not link-only questions and specific enough to be on-topic)?

  • Is it fine to answer the questions?
  • Should such questions be marked as duplicates of the referred questions?
  • Should such questions be deleted, at least after having asked for explanations by commenting the linked answers?
  • Should I even edit the linked answers to include code descriptions?
0

3 Answers 3

11

I think that making a new (on-topic) question is the best course of action in most cases. If the question is off-topic, then it should be closed for that reason alone (and I imagine that there are plenty of ways to ask that are going to be too broad).

This isn't to say that you couldn't try commenting on the old answer first (if you have the privilege and you're succinct). Unfortunately, there's a good chance the author isn't going to reply if the answer is old.

It's (probably) not a duplicate of the answered question, since "this code" is not an answer to "what does this code do?"


You should feel free to answer any question, including this type if you feel you can provide a quality answer. Answers in comments are generally annoying if the question isn't going to be closed.


There's no reason to delete the question after commenting on the answer in question. Again, if it's a valid question, then it doesn't need to be deleted. You're still not sure if the answer's author will ever reply; the reply may not be satisfactory, either ("I don't know it was 3 years ago I wrote this").


I would shy away from editing, especially drastically editing the code. The original author may feel that their answer provides a satisfactory amount of explanation for most people. (It's handy to have something minimal to copy out.)

It might be more appropriate to replace phrases like "use this: code" with "use the [X operator](link): code".

Of course, you can also check the help page on editing for the "official" rules.

1
  • 2
    You should always comment on the answer to tell the author that something's wrong with it. That comment can be a simple link to the new question, which the original answerer might be able to answer quickly.
    – Bergi
    Commented Aug 23, 2016 at 11:44
0

Common way to deal with "explain this code to me" questions is to close as "too broad" irrespective of code origin.

Note that it is generally fine to ask for clarification of one single feature of someone else code/answer. Questions still need to be up to SO quality standard - asking about existing SO question is not guarantee against downvotes/duplicate.

-4

Close them.

Requests for clarification should be posted as comments on the answer that requires clarification.

This improves the answers' quality, and keeps all the relevant info in 1 place.

9
  • 3
    What if the user cannot comment but they write a good question showing where their understanding breaks down? Commented Aug 22, 2016 at 12:44
  • 2
    @NathanOliver: Whether they can or cannot comment shouldn't be relevant, but if their lack of commenting privileges results in them putting time and effort into a complete question (and not just posting a link-only question, as mentioned in the question here)...
    – BoltClock
    Commented Aug 22, 2016 at 12:46
  • @BoltClock I'm sorry but I don't quite understand. Are you saying that if it is a good question (regardless if they can comment or not) then it should be okay? Commented Aug 22, 2016 at 12:51
  • 1
    @NathanOliver: I personally don't see anything wrong with such a question so as to be off-topic. As to whether that makes the question a duplicate of the answered one I'm not sure. Cerbrus has a point in keeping all the information in one place.
    – BoltClock
    Commented Aug 22, 2016 at 12:54
  • 2
    "What does this code do" is apparently a very valid question. That it applies to code from another Stack Overflow answer should not matter.
    – CodeCaster
    Commented Aug 22, 2016 at 13:21
  • 1
    @CodeCaster: Depends. Should be judged on a case-by-case basis. I'd rather see the answer that inspired the question improved. Otherwise, you may end up with a bunch of "How does this answer work?" duplicates.
    – Cerbrus
    Commented Aug 22, 2016 at 13:23
  • 1
    Well in that sense batch scripting is a lot like Perl and regular expressions. Chances are the original author doesn't even remember anymore how that code works. Less tongue-in-cheek: you don't have to expect an author to be willing to explain their code line-by-line. That doesn't necessarily make for a better answer either.
    – CodeCaster
    Commented Aug 22, 2016 at 13:25
  • 1
    Again, this is the problem with sites that rely on its users to moderate it. So many good questions have been closed for no real good reason. This site is supposed to support Qs & As and self answered questions, I took the time to post one earlier, it was very popular and the answer received 3 up votes in minutes, yet moderators grouped up on the question, used the excuse it was too broad, down voted the question, ignored the fact the answer I gave was receiving up votes and deleted it completely. One theory is they're trying to keep themselves up and the rest of the community down Commented Aug 24, 2016 at 4:21
  • 1
    Not to mention the fact that I've had answers that I posted yesterday completely stolen from me, almost word by word by higher ranking users/moderators and used to answer a question that was an obvious duplicate. They refused to mark their own stolen answered questions as duplicates & completely sidestepped any issue. The whole system is being abused because there's no moderation for the guys sitting at home deciding which posts stay & go, it's generally left to opinion rather than set rules, and those opinions generally favour the moderators Commented Aug 24, 2016 at 4:27

You must log in to answer this question.

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