Just a question on preference:
Given a method that returns a boolean value, how would you write an If statement to check the return value of it?
Like this?
private bool MyMethod()
{
// doing stuff
}
private void OtherMethod()
{
If (MyMethod() == true)
{
// do stuff if true
}
else
{
// do stuff if false
}
}
like this?
private bool MyMethod()
{
// doing stuff
}
private void OtherMethod()
{
If (MyMethod())
{
// do stuff if true
}
else
{
// do stuff if false
}
}
some other way?
Any reason why you would do it one way over the other?