string command = textBox.Text;
int leftOccurances = getInstances(command, "(");
int rightOccurances = getInstances(command, ")");
if(leftOccurances > rightOccurances)
{
for(int i = 0; i < leftOccurances - rightOccurances; i++)
{
command += ")";
}
textBox.Text = command;
}
What is the best way to write this as far as style and readability go? Should I:
- Leave it as is
- Add comments above main lines
- Add comments to the end of main lines
- Put #region #endregion tags around it
- Move the code into a separate method with a descriptive name such as "balanceParenthesis"
How would you guys do it?
This post has been edited by skybomb0: 19 May 2010 - 04:52 PM

New Topic/Question
Reply




MultiQuote






|