I hate reading questions with code and thinking "huh, what's wrong" only to realise the questioner changed the code after receiving the answer. What can be done to actually encourage users not to change code samples after asking the question?
The Code Review site, for example, clearly states not to change code after it's posted.
One assumes they have their reasons, real names are used by some users, so hiding the mistake may seem a good idea for future job applications, or maybe they just want to "help" future seekers by putting the correct code at the top. Whatever the reason, I think it's wrong and it should be discouraged.