I've noticed a particular user making subtle but important changes to code samples in other people's posts. For example:
In this case the change was from:
IEnumerable<IGrouping<char, string>> queryFoodGroups = from item in groupingQuery group item by item;
var queryFoodGroups = from item in groupingQuery group item by item;
I think that's a step too far. There may be a perfectly good reason that the OP is using
IEnumerable<IGrouping<char, string>> instead of
var and implicit types are not everyone's cup of tea. In fact the use of
IEnumerable<IGrouping<char, string>> may even be the cause of the bug when it should be (for the sake of argument)
IEnumerable<IGrouping<string, string>>, but the edit to
var blew the chances of finding that out away and now the code just works and no-one explained to the user why...and of course because the code works people may downvote for asking why a (now) working piece of code doesn't run. All because someone tinkered with the original code.
In this example he replaces a fully qualified class name with
var, fine if we know the user is developing in .NET 3.5+
This edit substantially rewrites the
using statements presumably to suite his house style but it's not what the user is running:
Whilst I'm all for knocking a sample chunk of code into shape (formatting, correcting spelling mistakes, glaring syntax errors), however I think that making changes such as these start to fiddle with the OP's original meaning/intent and the problem the OP is trying to solve. At the end of the day this is how the OP has written their code, this is what they're running we should solve the problem based on that, not how we'd like to see the code written.
Additionally, answers that highlight a particular nuance in the OP's code become lost if people start "fixing" code in a question to their preferred style rather than suggesting a better approach in an answer.