The code I looked at yesterday is undocumented and did not use any of the standard naming conventions for C# which makes it doubly hard! Well, to be truthful there was some comments here and there but the way the comments were written is what ticks me off. Here's a sample:
// If index @ 0 not equal to mLinks count
if (ckbSkip.Checked
&& mLinks.SelectedItems[0].Index != mLinks.Items.Count - 1)
{
mLinks.Items[mLinks.SelectedItems[0].Index + 1].Selected = true;
mLinks.SelectedItems[0].Selected = false;
}
Did you see what I meant?
The comment alone wasn't very helpful, at all!
It could have been written in this manner:
//if user wants to skip to next mfg
//and we are not at end of list, go ahead
if (ckbSkip.Checked
&& mLinks.SelectedItems[0].Index != mLinks.Items.Count - 1)
{
mLinks.Items[mLinks.SelectedItems[0].Index + 1].Selected = true;
mLinks.SelectedItems[0].Selected = false;
}
Code comments should say 'why' it is written that way and the code itself shows 'how' it's done.
