If I understand, the purpose of this community is to have useful questions and answers for current users of the relevant software/code. Some questions/answers sometimes contain obsolete code that has no direct bearing on the question (e.g. pertaining to an older code syntax that has been deprecated, is therefore not directly useful to current users, though it may well have another purpose, e.g. tracking version history).
[EDIT: added the bit 'that has no direct bearing on the question' to clarify]
Should we (basic users, moderators) strive to update obsolete code wherever it can be?
I have in mind questions with a high vote count and, naturally, code that would still be relevant after a few modifications.
At times, updating may not be possible. Example: a user asks how to do something, the accepted answer details a 200-line workaround, then a new answer points out that in the current version of the software, do_that()
will do it and more. In this case, it is probably best to leave the question/answers untouched. My question pertains to other cases, where an update of the code would keep the question/answers relevant to today's code syntax.
Example to fix ideas
This question currently has 143 votes, so it must get a lot of 'views'.
Rotating and spacing axis labels in ggplot2
In the question, the code is:
data(diamonds)
diamonds$cut <- paste("Super Dee-Duper",as.character(diamonds$cut))
q <- qplot(cut,carat,data=diamonds,geom="boxplot")
q + opts(axis.text.x=theme_text(angle=-90))
This is now obsolete, with the current syntax as:
data(diamonds)
diamonds$cut <- paste("Super Dee-Duper",as.character(diamonds$cut))
q <- qplot(cut,carat,data=diamonds,geom="boxplot")
q + theme(axis.text.x=element_text(angle=-90))
Interestingly, the answer (+182 net votes) has already been updated to the new syntax, creating a 'disconnect' between question and answer, and furthermore making it seem like the answer is offering to 'update' the code where its main purpose is not about updating the code but about rotating labels in a plot. Both question and answer are relevant to the current version of the ggplot2()
syntax.
Should I suggest an edit like the one above and, crucially, should a moderator accept it?