A number of posts on meta discuss what should or shouldn't be dealt with in an edit, but one thing I can't find any guidance on is whether an edit should change code to reflect a newer version of a language. For example, I'm seeing a lot of edits with edit descriptions along the lines of "Updated to Swift 2.0" and "Swift2 compatible." Posts like this one talk about leaving questions posed in a certain version of software as-is since it may indeed be helpful in the future for another user of the same software and version.
However, SO is pretty aggressive when it comes to encouraging people to include code in an answer and providing links which won't go bad in the future. But any inclusion of code into an answer will inevitably introduce a version of the language into the answer (albeit, languages don't often change so drastically that code from a version or two behind is useless in the latest version). The reasoning to include code in answers is understandable. But if the original question is less about the language and syntax and more of an SDK or platform issue, then it's fairly likely to exist in different versions of the language--since it's not a language issue to begin with. Thus, someone with a problem originally written in Swift 1.0 may be helpful to someone with the same problem now using Swift 2.0.
I've also seed answers where someone proposes an edit to the answer and adds a header to specify the code for a specific version of the language like:
Updated for Swift 2.0:
code for Swift 2.0 would be here...
So my question is this, if I'm presented with a edit that simply changes the code to a different version of the language, what's the best course of action?
Here are some options I've thought of:
- Reject the edit altogether (ensure the generic language tag is used and anyone viewing the answer will have to translate accordingly)
- Improve the edit and move the updated code into a new section labeled appropriately like shown above
- Tag the question with better tags (I hinted at this when I said some questions are less language focused and more SDK/platform related)