There's two options here on what could have happened:
- the community deleted the question because it did not meet the quality criteria
- the user self-deleted after the answer was posted
To avoid the first case you need to understand roughly which kind of questions get closed and deleted on SO, and simply avoid answering them if you don't want your effort to go to waste. The second case mostly happens with users posting homework (in an effort to remove the evidence), which are cases where answering is somewhat discouraged. But if the question is generally good, you can flag that case for moderator attention and it will likely get undeleted. Once your answer has an upvote, the asker cannot delete anymore.
Either that, or they need a way to nominate answers to no longer be relevant or current.
The current state of SO would have confused the hell out of me when I was a beginner. It seems like 90% of answers are outdated in some respect.
You can add this to Chrome by going to Settings -> Manage search engines -> Add. Name it 'Google (Within Last Year)' and make the Query URL 'http://www.google.com/search?q=%s&tbs=qdr:y&tbo=1'. Then set it as the default.
This filters out of date and usually irrelevant search results across the web. You can override it manually from the 'Past year' dropdown if the results are not extensive enough, which I do maybe 5% of the time.
It's not that I know the correct answer, that's why I'm reading, but I do know what does not work, and all too often that's all I see, just pages of things that are obviously not right.
I've found I just have to abandon the internet entirely these days and start reading the source code. It's really time consuming but it's starting to become also the fastest way. :-/
And yes, I usually go back and add an additional answer if I find things out, usually starting with "none of these are correct."
It's eternal septembered. What a hard system to fight off. I think wikipedia has done it but that's about it.
A similar situation is when you have a working answer, you know that it is not particularly good (inefficient, poor handling of edge cases, etc.), yet all of the answers are along the lines of your existing solution.
Programming problems are quite often a case of how something can be better solved. Consider the textbook example of sorting. The problem itself was always quite easy to solve, yet considerable amount of research were put into finding efficient algorithms since naive approaches are quite inefficient. We are lucky today since languages or libraries typically provide both the data structures and algorithms, but I cringe at the thought of how inept my code would be if I was relying on SO quality answers while learning how to program in the late '80s and early '90s (since there were many cases when you had to roll your own).
> Why bother answering, when answers must be accepted by the poster and poster does not even know they should accept an answer in the end?
There is no obligation to accept answers. Often the accepted answer isn't the best answer anyway.
I known this sounds badly and I'm not for gatekeeping, but this based on real life. If someone does some effort to answer a few questions first before asking themselves, they're more likely to be serious. Otherwise it's like those people on GitHub who open a ticket in your free repo and harrass you to fix it because they have a demo tomorrow!
BTW: writing detailed response from scratch should be an exception. In most cases the answer is already there in some existing question, but the person asking doesn't know some keywords to find it. So you can use your knowledge of the subject and point them to existing answer. It's faster this way and avoids duplicated content.
Seems there’s not much point putting effort in to do something “properly”.
Software Development in 2020, everyone.
This perfectly describes what our industry has become :)
Lots of people will go read your answer and upvote it. The fact that the questioner didn't check it is something you should mostly ignore.
Yet it's hard for me to find a single decent question that hasn't been answered any time I'm on StackOverflow looking to procrastinate by something work-adjacent.
It's clearly working and it's been working for years. In fact, it's even harder to get karma now. I don't know how I got to answer so many questions back when I used it 6 or so years ago because now any of those questions I answered would've been answered in minutes like they are now.
I go there to ask questions. I’ve asked nearly twice as many questions as I’ve answered.
I have gotten some very rapid, useful, answers to vexing issues.
I’ve also been treated quite badly. They seem to have a culture that assumes people that ask questions are a “lower caste” than ones that answer. Look at the folks with five- and six-digit scores. Most have single-digit question counts; with that digit frequently being “0.”
Shrug. Whatevs... I don’t lose any sleep over it. I haven’t been asking as many questions, lately. That’s because I haven’t been getting answers lately. Maybe part of the issue is that my current questions are a quite difficult and “production-related,” compared to my older ones. I have noticed that many answers tend to be rather “academic,” in nature, which I like, but that tell me that the person answering may not have experience applying the answer in the context of a shipping application.
I have learned to improve the quality of my questions, over time. One of the by-products of the way I’ve been treated, is that I have gotten better at doing self-research, and figuring out the answer on my own.
I’ve always been quite good at arriving at solutions on my own, but it takes time, and, quite often, a response to an SO question, even if done so in a condescending manner, would deliver an astonishingly quick answer; frequently with some orthogonal viewpoint that makes the answer more valuable.
I’ve also learned not to “slap back,” when someone is a bit snotty to me (I’m quite capable of doing so). Even if they aren’t being nice, they are doing me a favor, and I appreciate it. I don’t go there to make friends. I go there to get problems solved.
I have like 3 karma on my stackoverflow profile but most of my questions get answered provided it’s tagged well and is formatted well.
The karma system also rewards upvotes more than approved answer in practice, since just 3 votes will be more karma than approved answer.
I really gave StackOverflow a try, and I have no intention of writing an answer ever again. I took 30 minutes to write a very detailed answer to a question, only to find out that the question has been deleted days later.
Looking at similar questions, there are 40k+ unanswered questions, mostly very low quality and from users with almost no "karma".
Why bother answering, when answers must be accepted by the poster and poster does not even know they should accept an answer in the end?
StackOverflow needs overhaul, but at its current size, we're better off starting something new.