I posted an answer to someone else's question. Later, I found that my answer doesn't work any more (although it likely worked before). What should I ideally do now with my answer?
Couple things you can do:
- Edit it so that it works and ensure that it's relevant to the question being asked
- Remove it if it no longer works or is no longer relevant to the question being asked
Editing the code so it works or deleting the answer if it can't be fixed are the usual solutions, but before taking those steps you might want to ask yourself "Why doesn't it work anymore?"
What if the reason your answer doesn't work is because there is a newer version of the technology in which your previously working solution was rendered inoperable (due to changes in the language). Because programmers are often asked to work with older versions of languages, your answer might still be correct (and valuable) if it is based on an older version of the language.
If this is the case here, the the appropriate action could be to:
- Retag the question with the appropriate version specific tag (or tags).1
- Edit a disclaimer into your answer to indicate that this is applicable to only a specific version.
1 - you should only do this if in doing so won't render other answers incorrect, and if the OP has not specifically mentioned other versions in the question or comments
Now this doesn't appear to be the case for your specific situation since it is based on an public API that has been changed (and the older one is no longer available), but in general this is often a useful solution.