I am fairly new to programming and in my most recent work I created the following if else statement nested within a for loop:
for (int i = 0; i < originalColumnCells.Count; i++)
{
if (originalColumnCells[i] == sortedColumnCells[i])
{
// Do Nothing
}
else
{
return false;
}
}
In the if statement, as you can see, I want the method to do nothing if the statement is true. In this case, is it proper syntax to comment out "// Do Nothing", or should I leave it as open and closed braces? Or maybe put the braces at the end of the if line?
Any suggestions on the "right" way to handle this would be appreciated