34

I ran across How to find a string from a ZIP file using Python today. With all the changes in SO's mission emphasis (now much, much more on "welcoming" than in the past), I find myself unsure about how the company/staff expects us to evaluate the quality of a question.

This specific situation

The question I linked above presents a straightforward problem and asks for help debugging its behavior. They include a reasonable MCVE of an attempt at solving the problem, their desired behavior, and the behavior they're observing instead. If you know how to solve it, the change required is fairly trivial (just change f1.readlines() to f1.read().decode('utf-8') or whatever text encoding the file uses).

But beneath that surface simplicity lies a lot of underlying complexity. Specifically, the author of the question appears to be missing quite a lot of information that would allow them to arrive at the solution.

You can skip this gobbledygook if you're unfamiliar with Python, as the details don't really matter. But to go over what specifically makes the problem complex:

  • In the comments, you can see that they're not familiar with the differences between the binary (bytes) and text (str) types and how to convert between them (the decode call I mentioned above):

    the error i faced when i used read() . 'if files in f1.read():TypeError: a bytes-like object is required, not 'str' ' . r = f1.readlines() returns a list and i am not able to find a way to find a string in that list

  • They don't grasp that the in operator does not perform a contains check on each element of the list, but rather performs an equality check against each element. This is evidenced by the fact they need assistance, rather than solving the problem themselves.

  • Given that they are not familiar with the differences between binary and text types, it is also highly likely they are not familiar with text encodings and the issues surrounding them. They must learn about this topic to determine the correct encoding to apply.

  • There is also a concern with respect to styles of newlines. It's not clear if they wish to normalize the newlines, consider differences, or disallow the search string from containing them, which would allow them to be ignored. That they did not include information about this detail suggests they may not be aware of these issues, either.

  • The accepted answer was also wrong at the time it was accepted. It converted the list of lines into the repr, which formats the list into a literal expression (including the list brackets, quote marks, and escape sequences). That the asker did not recognize this also indicates they are missing knowledge about str and how it behaves on lists.

The kind of answer I would expect

If someone were to answer this question, I would expect the answer to cover all or at least most of these points of confusion. My understanding is that participants in SO are not supposed to simply hand the answer to the author, but explain why it's the best answer. This is partly because providing such an explanation allows the reader to make an informed decision about any caveats and whether the solution is appropriate for their use case, and it also teaches the user how to think about their problem and what pitfalls to watch for so they can solve related ones in the future without help.

The problem

The problem is that all the topics I mentioned are rather in depth. Each one is worthy of at least a separate, more specific question and answer. All of those points of information are also most likely duplicated elsewhere on the site.

This, in my opinion, makes the question Too Broad because a proper answer covers too many topics and too much information. This is why I refrained from answering and cast a downvote.

Generalizing

This is a specific example of a common problem on SO. A user asks a question that can be given a simple answer without explaining any concepts in detail, but as soon as you start to try to untangle the asker's misunderstandings and inform them of information they're missing, the answer balloons into something unmanageable and too time consuming to create.

Most of the questions I see exhibit problems of this nature, where the author does not appear to possess base knowledge of multiple relevant concerns for their problem. The asker also frequently demonstrates that they are perfectly satisfied with even a poor answer that appears to work in limited use cases but fails just beyond their immediately presented one.

The question: What does SO (the company) expect us to do about these kinds of situations?

What is the current expectation of how we are to treat such questions?

Is downvoting considered appropriate? Is close voting appropriate? Or is the fact a brief answer that fixes the presented code enough to make it on topic? Are the upvotes on the question and answer appropriate? Have the expectations on such questions changed in light of recent shifts in company focus (e.g., the "welcoming" push)?

Are my standards for an answer too high? Are such explanations and information not expected? Are my expectations about addressing points of confusion described above in line with the company's perspective? Or is it appropriate to post such brief answers on questions with so many underlying issues?

I would very strongly prefer a response from staff, or at least an answer backed up by statements from staff.

22
  • 4
    I think you've hit your head against the glass ceiling on this one. I do largely agree with you on this question, since there's a lot of ambiguity on this. I don't think you're going to be satisfied with any response you get on this, since not everyone is as well-versed in Python as you are, nor does the average close-voter understand the subtleties and nuances of the actual problems. The real problem then becomes one of turning what is effectively an n-dimensional problem into a troubleshooting exercise and solving that.
    – Makoto
    Commented Aug 19, 2019 at 22:47
  • 10
    My very strongly held opinion on this - we already don't support people who can't debug their code, but it's a blurry line on people who can't understand the code they're writing. The system itself is collapsing into itself because both camps would be right on a question like this; it's doing everything we're asking of it, yet there's enough complexity in it that the easy answers are simply incorrect.
    – Makoto
    Commented Aug 19, 2019 at 22:48
  • 2
    "What do we do" isn't the question that should be asked, is what I'm thinking. "How do we fix this" isn't a good question either since that implies that this is a problem. I think you're seeking an actual direction and objective of the site, such that a question like the one you're presenting can be answered without the angst you're describing.
    – Makoto
    Commented Aug 19, 2019 at 22:49
  • 10
    If you get an answer to that before I do, I'll buy you a beverage of your choosing. I wouldn't hold my breath, though.
    – Makoto
    Commented Aug 19, 2019 at 22:51
  • 5
    Related: Do I solve the user's problem or answer the question?
    – jscs
    Commented Aug 19, 2019 at 22:59
  • 6
    Not really an answer, but anyway: I don't think the expectations for answers have changed -- focus on answering the question as asked, slip in relevant extra advice if you can, stop before you find yourself writing a tutorial -- and I can't recall any statements from staff about such a change having taken place.
    – duplode
    Commented Aug 19, 2019 at 23:10
  • 2
    @duplode "focus on answering the question as asked" As far as I know, this was never an expectation. The Help explicitly approves of frame challenging, for example. While this doesn't require a frame challenge, it basically requires a tutorial to explain an answer.
    – jpmc26
    Commented Aug 19, 2019 at 23:14
  • 1
    @jpmc26 Sure, frame challenges and addressing the X in a XY problem are fine. What I meant was avoiding answers that sacrifice addressing the question itself for the sake of digressions.
    – duplode
    Commented Aug 19, 2019 at 23:18
  • 2
    Off the cuff; it seems like the undercurrent of the question is “why don’t we have a minimal understanding closing reason”, which has been discussed to death — including posts by Shog et. Al.
    – George Stocker Mod
    Commented Aug 19, 2019 at 23:21
  • 2
    Any answer I would give would point to those questions; but in short: go as shallow or as deep as you feel you need to to answer the users’s question.
    – George Stocker Mod
    Commented Aug 19, 2019 at 23:22
  • 2
    @GeorgeStocker The ones by Shog I can find about "minimal understanding" don't address this type of situation where the broadness comes from the range of underlying topics required to understand why that's the appropriate answer rather than a problem statement that fails to narrow the issue down. If you have a specific post in mind, a link may be helpful.
    – jpmc26
    Commented Aug 19, 2019 at 23:31
  • 1
    "I am a new contributor and you are supposed to be nice! Ha ha" Hmmm Commented Aug 20, 2019 at 11:00
  • 5
    The real problem are missing debugging skills of the asker. Commented Aug 20, 2019 at 11:04
  • 4
    You've hit on a contradiction between "welcoming" policy and "mentoring" policy. Welcoming requires you to solve the OP's problem in the fashion most useful to the OP and not lower their self-esteem by explaining all the details they don't understand. Mentoring requires you to teach the OP all the background information they lack.
    – user3458
    Commented Aug 20, 2019 at 16:05
  • 1
    Oh, and the original SO policy would have the OP re-submit the question at a more detailed level ("How to make readlines() work with ZipFile?" rather than "How to make my code work?"), where the question likely would become a duplicate.
    – user3458
    Commented Aug 20, 2019 at 16:12

5 Answers 5

37

Years ago, back when Stack Overflow was still young and the rocks were all hot and runny... I took a minute to answer a really straightforward question with a couple of links to the official docs. Literally a one-sentence answer, as that was all that was needed - as in your case, the problem just wasn't that hard.

...Almost 11 years later, there are numerous edits to that answer (by myself and others), and several dozen comments (a tidy pile of them deleted). Turns out, an awful lot of folks lacked the necessary background knowledge to make use of that simple explanation.

I could write (and, if you read the comments, some folks would probably appreciate) several lengthy treatises there on the topics of encoding, radixes, the historical and contemporary methods of handling of binary data in JavaScript... But I believed then and still believe that others will do a better job of this than me - my goal remains simply to provide a quick connection between the need and the API that solves that need. So I've added only enough elaboration to remind the folks who do know what they're doing of what they may've forgotten, and convince those who do not know what they're doing that they should probably follow some links and read further.

This may not be true tomorrow. What was common knowledge in '08 may be obscure in '28. Who knows? Fortunately, I - and others - remain free to edit, to add whatever information we deem necessary in the moment.

So... Don't worry about it. Provide as much information in your answer as you think the asker will need. If they - or some reader 5 years from now - inform you of their persistent confusion at some later date, then you can always edit to expand your answer then... Or, to provide a link to further reading that, while not strictly needed to answer the question, may be appreciated by those who lack the necessary background.

This site is, has been, and will continue to be a living document, collaboratively edited and maintained. There's no need to predict the future when what we write today is not set in stone!

16
  • 3
    Let me make sure I understand. The question is not to be considered Too Broad, and the expectations for an answer that I describe are beyond what the company expects?
    – jpmc26
    Commented Aug 20, 2019 at 0:08
  • (I'm not going to argue with you about whether that's good or bad or whatever; I'm just trying to make sure I'm getting the correct impression.)
    – jpmc26
    Commented Aug 20, 2019 at 0:14
  • 20
    No, it's not too broad; as you note, the question is focused around a specific problem with a well-scoped solution. The asker - or indeed others - may lack the background knowledge to understand that answer, but like Feynman and magnets this is always a risk when you don't know the skill of your intended audience. All you can do is guess and provide a reasonably-useful (and reasonably-scoped) answer; no one can expect otherwise, @jpmc26.
    – Shog9 Mod
    Commented Aug 20, 2019 at 0:14
  • Never heard the phrase, "all hot and runny" before, so I googled it and got butter, peanut butter, and some other unmentionables.
    – Robert Harvey Mod
    Commented Aug 20, 2019 at 17:09
  • 2
    Folks should really mention butter more.
    – Shog9 Mod
    Commented Aug 20, 2019 at 22:23
  • 3
    For whatever it is worth, this, in my opinion, means that SO is not focused on being a knowledge repository but rather on what I term a "help desk," meaning that our responsibility is to give out answers as much as possible rather than try to limit the site to questions with narrower but more general applicability. SO may consider being a knowledge repository a secondary goal, but it doesn't want to evaluate questions according to it. I do think this represents a shift in site values, but at the moment, I'm less certain how much of one than I would have been previously.
    – jpmc26
    Commented Aug 21, 2019 at 20:55
  • 1
    To be clear, @jpmc26: I'm just describing how I've always approached this situation. I think it's a reasonable approach, but... YMMV. Still, if I got away with it for years - using this account and at least a dozen others - I'd have to say it works...
    – Shog9 Mod
    Commented Aug 21, 2019 at 20:59
  • 1
    @Shog9 I don't know. It just seems to me that if our primary goal is to be a knowledge repository, it seems to me we would want to be more aggressive in culling questions that are this specific but require covering so many topics at once. Rather, we would want readers to piece together that information themselves. I've also come to realize that if the asker had a better grasp of the issue (or was willing to spend more time refining their question), they could have trimmed away the file reading portion of their question entirely. I.e., strictly speaking, it's not a minimal example.
    – jpmc26
    Commented Aug 21, 2019 at 21:06
  • Also to be clear myself, I'm not trying to make an argument either way right now. I'm just reflecting on the implications of this on how we view and discuss the company's and community's values and how the site works, both in intention and in practice. Maybe it's better if being a knowledge repository is a secondary goal, or maybe that was implicit in the fact we're a Q/A site rather than a straight up wiki. Whatever the case, it isn't in line with what I mean by primarily being a knowledge repository and would expect to flow from that goal.
    – jpmc26
    Commented Aug 21, 2019 at 21:06
  • 1
    I spent years working on a dairy farm, @jpmc26. The primary goal there is obtaining milk, but if you think you'll succeed in convincing cows to share that goal you're gonna have a bad time. Still, if you take care of your herd, feed them well, keep them happy and bred... You will get milk. Most of the folks asking questions here are not even aware of our goals; they probably should be, but expecting them to share those goals is likely not viable. Still, we can have milk in our tea.
    – Shog9 Mod
    Commented Aug 21, 2019 at 21:12
  • 2
    @Shog9 Yes, but I bet you didn't keep cows that weren't of any help in creating milk. And you probably didn't keep milk that wasn't drinkable. And certainly no one told you that you weren't being nice enough to the cows that were creating undrinkable milk or stressing out the ones that made good milk when you pulled them out of the herd.
    – jpmc26
    Commented Aug 22, 2019 at 0:03
  • It takes a couple of years for a calf to come of age, and of course longer still before you get milk, @jpmc26. Dry time is important for health as well. I get the point you're trying to make, but this is probably a bad analogy for that point.
    – Shog9 Mod
    Commented Aug 22, 2019 at 0:08
  • 1
    @Shog9 Actually, you're right. A knowledge repository isn't like a dairy farm. It's like the supermarket, where the milk is already pasteurized and processed and packaged and ready to go and any bad milk has been thrown out.
    – jpmc26
    Commented Aug 22, 2019 at 0:13
  • 3
    A knowledge repository isn't like a dairy farm, or a supermarket, or even this Q&A site. A knowledge repository is a goal, a platonic ideal. Analogies are useful in helping to shape a path toward such a goal, but must be discarded the moment they lose relevance. We "throw out" a fairly staggering volume of questions every week here; we got that bit pretty well handled. It's the other parts: the prep, packaging, stock rotation... Where we need work. Your question here concerns prep. I've done sorting and culling in several fields; my observation is that patience, diligence and speed are key.
    – Shog9 Mod
    Commented Aug 22, 2019 at 0:33
  • I see a note edited into the question that reads "Most comments here are outdated." Then why not flag them as NLN? Commented Aug 11, 2022 at 0:10
15

You are asking SE for policy direction, but I don't think the recent changes affect what to do for this kind of question.

  • A question about code that has numerous problems can be closed as Too Broad.
  • A question about code that has several problems can be closed as a Duplicate of the worst problem. A Gold Badge editor can add duplicate links to the other duplicates, if that is useful.
  • A question with several problems that make it hard to clearly answer is Not Useful to others and so is worth a down vote.

I do not believe the recent changes affect those reasons at all.

When a question suggests the asker lacks minimal understanding, SO can not give that understanding in one answer. Any attempt to do so will result in a chameleon question: each answer just prompts more questions. All we can do is point them to an answer for one of their problems.

1

When it comes to questions like these, I like to provide explanations where clear confusion has occurred. I will place a blurb about it, maybe go into some detail on a few important bullet points, and then provide a link to official documentation or a good article explaining the concept in more depth, and then move on the next part of the answer.

Here's a recent example of such an answer I wrote, although this one ended up being long-winded which I try to avoid when answering. On the same question, @mklement has a better answer (same question above) of condensing the important information into only a few bullet points with sources, and he does this on many of his answers.

0

I don't have a great guess into what the company would want us to do in this situation, but I do have my own opinion of what would be a good approach here.

First, since it is a reproducible error with no real dupe target and a simple solution and not caused by a typo, I'd answer the question rather than close it.

Start with the one-liner fix to the issue. Follow it up with a brief explanation of how that change addresses the problem where the original did not.

It looks like you've identified two categories of author confusion in here: ones related directly to why the attempted approach didn't work, and ones related to their inability to deduce the answer themselves. I'd briefly mention (though possibly not in depth) why the former ones were needed, but leave the second group for comments if at all.

Given your bullet points, it sounds like you'd need to mention that the attempted approach was reading text and not bytes, and why reading text won't work in this scenario. You'd also want to explain why you needed to specify an encoding. Links to Wikipedia or something would be a bonus. Either way, this gives the asker and future readers what they need to learn what they need to answer these questions for themselves in the future, without going on a long tangent.

The in operator part sounds like it's not strictly necessary for solving the problem, so you could leave it out, though you could put a brief one-sentence aside at the end explaining the concern. Likewise with the newline situation. In similar past situations as the newline situation, I've addressed this with verbiage like "If you want to do something special with different potential newline formats, you will of course need to account for this."

-4

Many simple questions, deceptive or not, can be origins of interesting answers and an opportunity to learn something for the person writing the answer as well. Every good teacher knows that. I have answered questions that had more than one issue and learned a lot, e.g. here. Or an actual manual question which I typically refuse to answer and tend to downvote (which I do sparingly) if the lack of research is too blatant, here: I didn't know the answer and was curious myself. Now I know.

The question you discuss here is not bad. I understand what the poster wants, they show code, they report the deviation from the expectations. That is already a lot they got right. Your problem with it is mostly that there are so many misconceptions that an answer would take too long to write. Well, then don't. No harm done. Also no reason to downvote. Not at all. Downvoting means "looking at this question will waste your time". But somebody who has nothing better to do at work or at 2 am can sit down and get all the issues straight and learn something on the way.

Oh, and you know what: I could not care less what SE Inc. thinks.

3
  • That's funny, somebody downvoted the linked answers. Guess they don't like my lenient attitude ;-). Commented Aug 13, 2021 at 16:48
  • What makes no sense is that my question received a couple downvotes, too. lol. Dunno why everyone seems to be downvoting everything related to this question. You'd think someone would agree with something to upvote it instead.
    – jpmc26
    Commented Aug 13, 2021 at 23:33
  • @jpmc26 I didn't... it is a valid question. I suppose the downvoters are disjunct sets ;-). Commented Aug 14, 2021 at 0:10

You must log in to answer this question.

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