On SO, you can sometimes see QA-pairs that are well written, has high score and made perfect sense when they were written. But today, they are extremely outdated.
It can be the situation that the answer is based on the features available in a language at that time, but more recent versions of the language standard makes the old answer to just seem like an ugly hack.
One example could be for loops in C89 vs C99. In C99 you can declare the loop counter to be local to the loop, which in terms of design is a massive improvement.
/* C89 */
int i;
for(i=0; i<10; i++) {
/* Loop body */
}
/* C99 */
for(int i=0; i<10; i++) {
/* Loop body */
}
There are probably way better examples and Iâm not looking for discussing this particular example. My question is about how we should treat these kind of questions. Where an approach that was sane and standard back in the days is considered very bad code today. One problem with these questions on SO is that they are often popular and show up early in google searches.
On SO, the usual advice is âWrite a better answer, and if itâs better it will rise to the top.â As we all know that does not happen. Also, in one way I think it is wrong to âpunishâ those users who wrote an answer that was good then by downvoting them today.
I think a sound approach is some kind of archiving. The question and answer should still be visible, but it should be very clear that it is considered outdated and that the answers should be taken with a grain of salt. As with previous suggestions from me, of course this can have itâs flaws and details can be discussed, but I propose something like this:
- On old questions (at least two years?) you can close vote for archiving
- An archived question does not accept more answers
- When you view an archived question, thereâs a big banner telling you that the content may be outdated
- The post also gets a wiki box that can be edited by users to provide details
For the above example, the wiki box could have this content:
This question was posted when C89 was the defacto standard. Today C99 is the most common C-standard and it allows much better ways of solving this problem.
Deleting the questions would be very bad. Such posts can be very interesting to read from a historical perspective.
What do you think?