Someone is sure that availability check is performed no matter what
-
Of course, variables changed, methods renamed, and parameters omitted to protect the (not so) innocent.
// some code here
if (condition_a)
{
if (condition_b)
{
// do something here
if (AlertBox("Something wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else if (condition_c)
{
// do something else here
if (AlertBox("Some other thing wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else
{
CheckAvailability();
}CheckAvailability();
}
else
{
CheckAvailability();
}// more code here
-
Of course, variables changed, methods renamed, and parameters omitted to protect the (not so) innocent.
// some code here
if (condition_a)
{
if (condition_b)
{
// do something here
if (AlertBox("Something wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else if (condition_c)
{
// do something else here
if (AlertBox("Some other thing wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else
{
CheckAvailability();
}CheckAvailability();
}
else
{
CheckAvailability();
}// more code here
i like the path in which the availability gets checked twice
-
Of course, variables changed, methods renamed, and parameters omitted to protect the (not so) innocent.
// some code here
if (condition_a)
{
if (condition_b)
{
// do something here
if (AlertBox("Something wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else if (condition_c)
{
// do something else here
if (AlertBox("Some other thing wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else
{
CheckAvailability();
}CheckAvailability();
}
else
{
CheckAvailability();
}// more code here
Looks like CheckAvailabilty() is void, and has to throw an Exception in case of non-availability. Consequently, that call has to be wrapped:
try
{
CheckAvailability();
}
catch(Exception ex)
{
if (AlertBox("Some other thing wrong here. You wanna continue?"))
{
CheckAvailability();
}
}You are right, that guy does not know how to do things correctly!
-
Of course, variables changed, methods renamed, and parameters omitted to protect the (not so) innocent.
// some code here
if (condition_a)
{
if (condition_b)
{
// do something here
if (AlertBox("Something wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else if (condition_c)
{
// do something else here
if (AlertBox("Some other thing wrong here. You wanna continue?"))
{
CheckAvailability();
}
}
else
{
CheckAvailability();
}CheckAvailability();
}
else
{
CheckAvailability();
}// more code here
That just makes me angry.. :mad: