-21

I recently answered a question and then that question was closed as duplicate of the usual canonical "null pointer exception" questions and my answer was downvoted.

As far as I am concerned, this is not useful to anyone. This was a specific case where the canonical NPE question would not have helped the person who posted the question. My answer dealt with the specific case that OP had and he was able to fix his problem with my answer. Other developers who have the same situation would also not be helped by the canonical NPE question but would be helped by my answer.

What is the correct approach? I have enough reputation points to just reopen the question myself, but am not sure that this is the best approach. I would prefer to message the person who closed the question in order to discuss or revise this decision, but it doesn't seem like there is any way to do this on Stackoverflow. Looking for answers/suggestions from the community."

NOTE: I am not asking for this specific question to be reopened, and I am not asking for opinions on whether or not this specific question should have been closed. I'm asking a general question about what to do when a question is closed as duplicate (using the usual canonical/general question as a reference), but I disagree with the closure.

Here is a link to the specific question, if anyone is interested:

Simple Android Calculator app crashes on running

8
  • 3
    Questions: 1) How helpful is the question to future visitors? How much will it add to the current knowledge base over and above the canonical questions used to close it? And 2) How would you rank the quality of your answer as a general answer for similar future questions, compared to the answers in the canonical questions used to close it? Commented Apr 22, 2021 at 11:36
  • 6
    Myself, I have seen low-quality, common duplicate questions answered by a simply stunning answer, one that should be enshrined for the ages and thus kept. Sorry, but I am not seeing that here. The answer is OK, and is helpful for the OP, but that's about it. In my opinion, the question should be left closed and possibly later deleted. Commented Apr 22, 2021 at 11:39
  • 2
    In this case you can ping them in the comments. It doesn't autocomplete, but they should be notified nonetheless.
    – Ivar
    Commented Apr 22, 2021 at 11:40
  • 10
    Was wondering how long it'd take for this to spawn a complaint. Seriously - was expecting it when I saw an 84k user with a history of denial of dupe usefulness. Writing an answer Commented Apr 22, 2021 at 11:59
  • @David - You could always answer the duplicate. If it truly is a duplicate then your answer should answer both questions. If that isn’t the case then the question should be reopened. The author of the duplicate can make that case. Commented Apr 22, 2021 at 12:07
  • Related (I believe): Are canonical duplicates useful anymore?
    – Tomerikoo
    Commented Apr 22, 2021 at 12:18
  • 2
    Isn't your answer a duplicate of stackoverflow.com/questions/19078461/… ? I'm not an SME in kotlin but in javascript same conceptual problem literally shows up daily so I did a search and found numerous similar answers. Adding additional duplicates would seem more sensible than re opening it
    – charlietfl
    Commented Apr 22, 2021 at 12:22
  • 2
    Also a duplicate of this question (Kotlin and Java are irrelevant and interchangeable in this case).
    – Andrew T.
    Commented Apr 22, 2021 at 12:27

1 Answer 1

28

I recently answered a question and then that question was closed as duplicate of the usual canonical "null pointer exception" questions and my answer was downvoted.

As far as I am concerned, this is not useful to anyone. This was a specific case where the canonical NPE question would not have helped the person who posted the question

Since you decided to strawman the situation: no, that isn't entirely true. It also seems you only read one of the dupe targets and disregarded the other two, including the one that's directly applicable to the situation (spoiler: it's the exact same thing in a non-generic way, meaning about the exception related to the function, rather than just the exception).

You're right that not all NPE questions are automatic dupes of the canonical NPE question. That's why I hammered it as a triple duplicate, including one that isn't the NPE canonical, but that is the exact same situation that also addresses the Android-specific issue in the question.

The NPE canonical is for good measure, because not everyone understands what an NPE dupe is. I can remove that target (as well as the MyApp has stopped one) and there's still going to be a target that applies.

"Unfortunately, MyApp has stopped" is a standard hammer target for questions that don't include a stacktrace (I don't care if the error is obvious, the stacktrace is considered a fundamental part of an MCVE in the context of Android and Java crashes), as well as the canonical for findViewById() NPEs.

I included the canonical debugging question for the same reason as I included the NPE canonical: not everyone knows how to debug apps and therefore find the relevant search keywords. "findviewbyid nullpointerexception" finds the third, non-general question on the dupe target list.

and my answer was downvoted.

I always downvote answers to bad duplicates (emphasis on bad: there are questions that're good sign posts, but this ain't one of them) I come across, assuming I still have downvotes left that day. If you have a problem with that, you can stop answering the nth dupes of questions that have already been asked so many times that at this point, people answering them do it for the rep, and not for the generation of useful content to the site. Or, you know, make sure I don't see it.

If you're looking to write a canonical answer, do so on the canonical question rather than pretending SO is a forum and posting tiny answers to several duplicates. I'm also getting back to this in a second.

I'm asking a general question about what to do when a question is closed as duplicate (using the usual canonical/general question as a reference), but I disagree with the closure.

See the above for why the question was correctly closed.

In general, the advice would be to reopen. For this question specifically, please don't. I can easily find 5 dupes of findViewById returning null to replace every single target on that list.

If you have some new information to bring to the table, add that as a new answer to the canonical for findViewByID() returns null (we also have a separate one for fragments and custom views that has answers that overlap with the activity one). Make the canonicals useful rather than creating a decentralized mess where some questions contain some bits of information about the exact same situation while others don't.


Serious side-note on this: Have you ever tried using a forum to find answers, where there aren't duplicate mechanics? Comments mixing with answers aside, some posts have some answers, meaning you might have to visit 5-6 threads that might not work or even apply. Forums work out even worse than Stack Overflow in terms of answer aging. While we do have a problem with answers becoming outdated, new answers can at least be added and upvoted without getting slapped by the mods for resurrecting a dead thread.

The reason SO has dupes in the first place is to minimize the number of separate "threads" (questions on SO; we aren't a forum), and also to prevent indirect answer duplication (not always the plagiarism type, but to avoid having 15 different questions that all contain the same answer of varying quality).

Your answer is essentially this one but more direct and less general, without actually explaining why findViewById behaves that way in the first place. It's also equivalent to this one, again with the same caveats as the other one (general, no explanation of why, just "do this to fix your code") - your answer therefore adds nothing new to the overall discussion about this specific NPE, that we've already documented substantially for several different contexts. I wouldn't mind seeing these questions merged, but that's a completely unrelated discussion that doesn't affect the dupe status of the question we're discussing here.

And finally, because why not:

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