I mean would it be bad practice if I want an if statement to have an else, but there is a nested if statement "in my way" so I use a blank else statement such as "else ;" or "else { }" to escape it?
ex:
if (lsvAddons.SelectedItems.Count > 0)
foreach (ListViewItem A in lsvAddons.SelectedItems)
if (Addons[A.Index] != null) Addons[A.Index].DoHelp();
else { }
else Console.WriteLine(_GenericHelpString);
vs:
if (lsvAddons.SelectedItems.Count > 0)
{
foreach (ListViewItem A in lsvAddons.SelectedItems)
if (Addons[A.Index] != null) Addons[A.Index].DoHelp();
}
else Console.WriteLine(_GenericHelpString);
Or even:
if (lsvAddons.SelectedItems.Count > 0)
{
foreach (ListViewItem A in lsvAddons.SelectedItems)
{
if (Addons[A.Index] != null)
{
Addons[A.Index].DoHelp();
}
}
}
else
{
Console.WriteLine(_GenericHelpString)
}