Raised This Month: $ Target: $400
 0% 

[ SOLVED ] Difference between the codes?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-11-2015 , 21:18   Re: [ HELP ] Difference between the codes?
Reply With Quote #1

I would do the first one because it's cleaner and more logical.

Code 1
PHP Code:
if ( all of these things are true )
   do 
this stuff 
Code 2
PHP Code:
if ( all of these things are true 
    exit 

do 
this stuff 
Sometimes code 2 makes sense depending on what kind of stuff is going on. But for a basic 2-3 line function, definitely code #1. There is no better from a performance perspective, it's really about taste.
__________________

Last edited by Bugsy; 11-11-2015 at 21:19.
Bugsy is offline
Reply



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 17:55.


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