Raised This Month: $ Target: $400
 0% 

if elseif else?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-28-2013 , 00:18   Re: if elseif else?
Reply With Quote #7

Quote:
Originally Posted by vip-colgate View Post
I knew that for a long time ago...
Code:
if( one ) ...
else if( two ) ...
else ...
and...
Code:
if( one ) ... return
if( two ) ... return
...
Can someone tell me what's the difference between them?
Which one is better? or no matter?
The latter (second one) is poor coding and might not work in all situations (i.e. it is context dependent). Always use the former.
__________________

Last edited by fysiks; 05-28-2013 at 00:19.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode