View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-24-2016 , 12:44   Re: [HELP] Fast or Readable?
Reply With Quote #6

Quote:
Originally Posted by Depresie View Post
Since we are talking about this

PHP Code:
number function1 : function 
I have a question, is there a way to do this without an else ? for example
PHP Code:
number ? function 
I don't think it's worth it. Things like this are typically done by those that care about the number of lines in their plugin. The focus on code, IMO, should be efficient while also being easy to read and understand. Line count means nothing from a performance perspective and it's usually at the expensive of readability.

However, something like this is fine.
PHP Code:
set_user_healthid , ( iSomeValue == 34 ) ? 90 100 );

//instead of 

if ( iSomeValue == 34 )
    
set_user_healthid 90 );
else
    
set_user_healthid 100 ); 
__________________
Bugsy is offline