>>>>>>I also agree. Having multiple exit points is confusing and is a bad programming practice according to every programming class I have had in college.
>>>>>
>>>>>Then I would disagree with all those classes you have had in college;)
>>>>>
>>>>>Cetin
>>>>
>>>>
>>>>Post an example, please.
>>>
>>>
public bool SomeMethod() {
>>>if ( FirstCheck() == false ) { Messagebox.Show( "blah blah" ); return false; }
>>>if ( SecondCheck() == false ) { Messagebox.Show( "blah blah" ); return false; }
>>>// other code }
>>>
>>>Imagine this code is in fact long. It would simply be inconvenient to have multiple if .. else. endifs and to read all the code to see what is returned from a code. I can easily say it returns immediately if FirstCheck() returns false.
>>>
>>>Cetin
>>
>>
>>Function SomeMethod() AS Boolean
>>
>> Dim result as Boolean = False
>>
>> If FirstCheck() = False Then
>> result = False
>> ElseIf SecondCheck() = False Then
>> result = False
>> Else
>> 'Other code here
>> EndIf
>>
>> Return result
>>
>>End Function
>>
>>
>>I would argue that my code is easier to follow and would be easier to maintain, even if it is a bit longer.
>
>We can argue for years and it wouldn't change the fact that multiple returns code is easier to follow.
>Cetin
I disagree with that fact.