# Is this edit okay?

A struct within a class, and this is the edit history: https://codereview.stackexchange.com/posts/60534/revisions

The original code include this method:

public bool AddStudent(string name, int age, string grade)
{
// To do something
}


None of the code in the snippet provided uses this method. The plain-English part of the code makes no mention of this method.

Moreover, per the help center, comments in the place where executable code belongs makes questions off-topic.

As far as I can tell, including this method makes the question off-topic. With its removal, the question is a little closer to being on-topic (though it lacks some context making it unclear).

In this specific case, removing isn't enough to make the question on-topic. However, in other cases, potentially removing a method like this could make the difference in a question being on or off topic. As such, is it okay to remove methods like this from questions?

This question presumes that the code being removed makes the question off-topic (per the example/pseudo code rule--not the broken code rule), and that the method being removed is not referenced either by the included code snippets or the asker's plain-English part of the question.

The problem with that question isn't that it's unclear.

class StudentMangement
{
private struct Student
{
public string Name { get; set; }
public int Age { get; set; }
public string Grade { get; set; }
}
}


That edit removes a piece of noise, that could have also been edited like this:

private List<Student> _students = new List<Student>();

{
}


But whether we add or remove code, doing that changes OP's intent, and as such, is an edit that, if I'd have seen in the review queue, I would have rejected as "incorrect, or an attempt to comment".

That said, I don't think closing as "unclear what you're asking" was the right call here. OP's intent is very clear IMO:

What is the best practice for a C# struct?

Best practices in general (that is, it's okay to ask "Does this code follow common best practices?", but not "What is the best practice regarding X?") [...] then your question is off-topic for this site.

The question is simply not asking for a peer review within the site's scope.

• This doesn't answer the actual question asked all that well. I think everyone probably agrees the question belongs closed in its current state. Aug 20 '14 at 11:22
• Closed, yes. Unclear what's being asked, not at all. As for the edit in question, I think this answer is pretty clear,I don't think it's a very good edit, I would have rejected it. Aug 20 '14 at 11:31
• Your answer isn't clear though. That's why I commented. You say "this edit removes a piece of a noise" which seems to be a good thing, then you offer an alternative edit, which ADDS code (and adding code is drastically different) and say that your example is something you would have rejected, but you don't directly comment on my edit to remove the chunk I removed. Aug 20 '14 at 11:36
• Oh I see what you mean now, right. I'll edit later, thanks! Aug 20 '14 at 11:43

You will not alter the OP's code, unless it is clear that their presented code does not match the code they have.

That stuff is subject for review. The objects used. The design. The algorithm. The whitespace. The blank lines between the code statements. The length of each line, the words used for variable naming, the style of the comments, the format of the comments, the language of all the naming and just about anything else that you can attribute to that piece of text sitting in the code box.

Exceptions include:

• They can't paste in their code due to some wacky error
• They've put up a pastebin containing a small code sample
• There's a comment along the lines of "I used tabs and it's not displaying properly".

That's when you edit the code to be indented by 4 spaces. But guess what? By doing so, you don't alter the code. You only alter it as such that the code in the code box matches the code that the OP has. You know, the code that the OP wants to get reviewed.