Codetown ::: a software developer's community
Codetown is a software developer's community. It's a technical networking and educational group focused on software development.
I was searching through Google, and clicked on a link to a SO question. The weird thing was, it took me straight to an answer instead of to the question like it normally does.
I've never noticed this happening before. This link is using
/q/ instead of
/questions/ like most other links.
/q/ links supposed to be showing up in results? Interestingly, Google can only find 301 such links if you search for
site:stackoverflow.com/q/ (it shows 1.7M initially, but then drops when you go to page 11 ¯\_(ツ)_/¯).
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.
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.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 gobbledy gook 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.
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.
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 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.
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.
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? Is such explanation and information not expected? Are my expections 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 response from staff, or at least an answer backed up by statements from staff.
Join us for a Git presentation featuring RustyRusty Phillips has been a polyglot developer for over 20 years (and Java to some degree during all of that time), and has spent that time special…
Join us for a talk featuring Richard Thibault Richard Thibault is a full-stack web and mobile developer with over 25 years of experience in the software industry. He is currently focused on Java a…
Watch for details on our upcoming meetings. OrlandoJUG meeting's fall on the 4th Thursday of every month, in case you want to mark your calendars. Stay tuned for details! GatorJUG meets the 2nd Wednesday of every month.
The details are posted in the CodeTown Events section. Please RSVP so we'll know how much pizza to order. Stay tuned! ...Mike
A while ago I asked a question about using RS-232 communication with Java. It seems as though I need to abandon that route because it no longer fits the desired system requirements. Thanks to Nem for his advice on that one. Now what I need to be…Continue
Hello all:I have been working on a GUI interface for controlling lights in a planetarium. I had some trouble getting the communication to happen, and received some help from this forum to get past that hurdle. I now have a functioning GUI that I…Continue
I need to get a better handle on the advantages of a RESTful web-based API. People tell me they scale better than other methods, but I don't see how they reduce database access or have any other feature that helps handle large amounts of traffic.…Continue
What books should be on the bookshelf of EVERY Java programmer, no matter what specific technologies they are working on?The two that come to my mind areThinking in JavaJava Concurrency in PracticeWhat else am I missing?Continue
Hello all: I am fairly new to the Java world and would like some advice on how to handle rs-232 communications with a Java based GUI I am working on. Several years ago I created a similar GUI with Visual Basic, but my coding skills are a bit rusty…Continue