12

I recently provided an answer to a question that was not perfect, but I deemed it reasonable for Stack Overflow. I posted the second answer here.

When parsing strings, code is adding string contents and last part of string?

I am fairly new to SO and just recently started getting involved in the community more seriously. I understand being downvoted for a poor answer, and am open to criticism of my answers. Another user downvoted my answer because they deemed the question as a "bad" question. They explained that answers to bad questions do not help. Can anyone explain what to do in these circumstances? In my opinion the question provided sufficient background and a minimum reproducible example in order to provide a good answer. This makes me hesitant to provide answers.

13
  • 14
    You and anyone else can answer any non-closed question. Once posted voters might cast votes on the answer you posted. In this case it was explained why the answer wasn't useful. You're free to take that advice into consideration and adapt your future (in)actions on it. Votes are judgement calls. Whether a question is a useful addition to the knowledge base we try to currate here and therefore warrants answers is also a judgement call. Not all judgements align 100% of the time. Some mis-judgements never get rectified. Welcome to Stack Overflow.
    – rene
    Commented Oct 3, 2022 at 18:16
  • 2
  • 3
    is it even a bad question?
    – Kevin B
    Commented Oct 3, 2022 at 18:19
  • @KevinB between you and me we have seen worse?
    – rene
    Commented Oct 3, 2022 at 18:22
  • 21
    Also, be careful with your wording I was downvoted. No, you were not downvoted. An answer you provided was deemed not useful by two voters so far. Slightly related: meta.stackoverflow.com/questions/269461/…
    – rene
    Commented Oct 3, 2022 at 18:25
  • 7
    @rene it is much better than a lot of new questions. It is still bad for the reasons I detailed: no attempt to minimize an MRE, no apparent attempt to diagnose the problem independently, and an implicit at best question. Yes, asking questions is hard. Yes, trying to get help debugging code almost never leads to a good question. Commented Oct 3, 2022 at 18:43
  • 2
    A note that it's pretty established that downvoting otherwise good answers simply for existing on a bad question is not okay. All posts should be voted on based on their own merits, which means not penalizing good answers for bad questions, or vice versa (Of course, that doesn't mean people don't do this from time to time).
    – zcoop98
    Commented Oct 3, 2022 at 21:29
  • 4
    @zcoop98 That answer stands as one opinion on the subject, and many more opinions exist to the point that that answer is far from a community consensus. For what it's worth, "if you consider the question not having value I can imagine that the answers have no value and as such warrant a down vote".
    – E_net4
    Commented Oct 4, 2022 at 8:00
  • @E_net4thecommentflagger You're welcome to read it that way, but it dovetails with the help center guidance on voting, which clearly emphasizes voting on content itself: "Voting up a question or answer signals to the rest of the community that a post is interesting, well-researched, and useful, while voting down a post signals the opposite: that the post contains wrong information, is poorly researched, or fails to communicate information." The only case where voting like this makes any sense is for Roomba, and that only matters if an answer on a bad question has upvotes.
    – zcoop98
    Commented Oct 4, 2022 at 15:10
  • 1
    Otherwise, voting down answers to penalize or to "teach" answer OPs is voting the user, not the content, which is much more established as an expressly incorrect way to vote.
    – zcoop98
    Commented Oct 4, 2022 at 15:11
  • 2
    But that's part of the problem, @zcoop98. When people talk about downvotes on answers to low quality questions, people too often jump the boat on calling those downvotes a "punishment towards the answerer", rather than a plain reflection of the quality of the answer which is inherently bound to the question at hand. At best, it may serve as a signal that the effort of answering the question could have been better spent, but as we continue to communicate that downvotes are not a punishment or an attack, we may well have the courtesy of following the same interpretation of votes in these cases.
    – E_net4
    Commented Oct 4, 2022 at 15:29
  • they are a punishment, if they weren't there'd be no reason for anyone to care that their post is being downvoted. arguing that it is or isn't a punishment is somewhat of a weak front. it's irrelevant, because to the receiver it's always going to feel like a punishment regardless of how much guidance exists that says otherwise. --- it is reasonable to consider an answer that is "correct," not useful or low quality. Answers are inherently linked to the question they're answering.
    – Kevin B
    Commented Oct 4, 2022 at 15:36
  • 1
    @E_net That's a fair point, but this was a case where the voter was explicit that this was their reasoning in a comment ("Because the question is off topic, and answers to off topic questions are not useful and make the site worse"). When people vote like this, I feel it hurts our ability to hold that votes aren't punishment & are purely for content– because downvotes made under this reasoning are inherently not for the answer's content, and I would argue are punishment for the answerer performing an action with which curator did not agree. My position is that we can't have it both ways.
    – zcoop98
    Commented Oct 4, 2022 at 16:02

2 Answers 2

10

Going to side with you in this case. I don't really see a problem with this question.

Their scope and ambitions aside, what they present is a question with a specific and narrow issue, just enough code to reproduce it, and sample inputs and desired outputs.

Of all Python questions around, this one does better than any of them tenfold since it incorporates a lot of what we expect from a question asker.

So I wouldn't read too much into this one. There have been some questions which have been more a requirements dump than a "hey, I have this specific problem, can you help out on this?"-kind of questions, which you really shouldn't answer.

But in this case, I could see giving you a pass on this.

3
  • 5
    Reproducing the issue takes much less code than was presented. Commented Oct 3, 2022 at 18:45
  • 6
    @KarlKnechtel: I'm referring to the notion that yes, one could copy this code into their IDE of choice and see the same issues. That to me is just enough.
    – Makoto
    Commented Oct 3, 2022 at 19:07
  • 4
    I get it that the bar in python is low but this is far from an MRE. It has tons of unrelated code and it does not work out of the box. It fails with ImportError: cannot import name 'randint' from 'random' for me – because it needlessly lugs around a significant dependency that seems to be broken on recent Python. Commented Oct 4, 2022 at 6:39
-10

I am the user in question. I also downvoted the accepted answer.

The question is much worse than "not perfect". I explained my reasoning in a comment on the question:

Please read How to Ask and https://ericlippert.com/2014/03/05/how-to-debug-small-programs. Note well that this is not a discussion forum; "Any help would be appreciated!" is not how the site works. We expect a specific, clear question up front, which results from your own best attempt to locate and describe a specific problem. This starts with you carefully checking what the code does, step by step, and figuring out where that diverges from your expectation. After that, focus on that part of the code with a minimal reproducible example.

To be clear: these factors make the question worthy of closure, and not on topic for the site. Aside from the fact that there is not actually a question (the title ends with a question mark, but it is really just describing an undesired behaviour), it is essentially a request to debug several dozen lines of code.

"Sufficient background" does not save a question. It's often not helpful - it's only really necessary for OP to explain why something is being attempted, if it's an inherently strange thing to attempt.

The example is not a minimal reproducible example because it is not minimal. It is the entire command parser. Before posting, it is OP's responsibility to check what the code does, step by step; to have a specific mental model for what should happen at each step (in order to solve the problem); to identify where the code starts doing something different; and to create a code example which isolates that undesired behaviour.

The question being asked is about what ends up in the args list that is passed to some command. So right off the top we already know that everything in the code that has to do with looking up the command and invoking it, is completely unrelated - the problem has already occurred. So the entire if os.path.exists(commands_dir) and os.path.isdir(commands_dir): block is irrelevant, right off the top. All the error handling and fancy display of error messages is also irrelevant, because we're considering a case where the program is expected not to report an error.


Keep in mind that the purpose of Stack Overflow is to build a searchable Q&A library. Who would search for this? If we actually isolate the problem, then it would be someone who has the same problem. For such a person to find the question, the question has to reflect that problem.

Because it takes a lot of words to explain the specific way that the code is going wrong, a succinct question would instead focus on the task: something like "How can I parse a string into separate words, but treat quoted strings as a single word?". I tried to put that into simple language because I expect that someone asking this question wouldn't know the relevant terminology (words like tokenization).

But at any rate, once we have identified a question like that, we have something that can be researched. I did not get that far because I was looking at so much code; but if the question had been properly asked I might have then searched for a duplicate to use for closure (rather than casting a "needs MRE" close vote).

7
  • 7
    Usually, voting/roomba are the tools that deal with questions not being searchable/useful, we don't need to forbid answerers for that process to work. While i agree general debugging questions are 9 times out of 10 useless, they aren't off topic and shouldn't be treated that way just because it's a debugging question that hasn't been broken down into it's tiniest parts.
    – Kevin B
    Commented Oct 3, 2022 at 18:45
  • 3
    The second page of closure reasons used to be titled "Closing -> Off Topic", to my recollection, and that terminology stuck with me. The purpose of decomposing a debugging question is twofold: if there is one problem, then focusing on that problem makes it something searchable; if there is more than one problem, then that establishes that the question "needs more focus" (although this is usually salvageable). My understanding is that answers, especially upvoted ones, interfere with the Roomba, so I am also trying to prevent that. Commented Oct 3, 2022 at 18:48
  • 1
    While you may be well within your right to downvote an answer to a question you deem poor under the justification that the answer is "unhelpful", know that you go against established norms on the subject, and also that you accomplish very little in terms of curation. Questions get closed. Poor questions should be dealt with on their own accord; answers are separate posts and should likewise be judged on their own accord. Downvoting an otherwise good answer does absolutely nothing to deal with a bad question.
    – zcoop98
    Commented Oct 3, 2022 at 21:34
  • 6
    "Downvoting an otherwise good answer does absolutely nothing to deal with a bad question." My position is that if it is pointed at a bad question, it cannot be a good answer. Further, it does help deal with the question, in that answers with a score > 0 prevent the RemoveAbandonedClosed Roomba rule from triggering. Commented Oct 3, 2022 at 21:37
  • 3
    @KarlKnechtel I feel that it is okay to close the question as a duplicate in this case, the OP shows a lot of unnecessary code but it is easily seen that the main problem is to tokenize / lex the string. In this case a duplicate closure is much more helpful for OP and anyone else happening on the question. Commented Oct 4, 2022 at 4:48
  • "I am the user in question." What user? You downvoted the answer linked?
    – philipxy
    Commented Oct 6, 2022 at 1:20
  • Yes, you understood correctly. Commented Oct 6, 2022 at 5:20

You must log in to answer this question.

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