Raised This Month: $51 Target: $400
 12% 

[HELP] Fast or Readable?


Post New Thread Reply   
 
Thread Tools Display Modes
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-24-2016 , 14:35   Re: [HELP] Fast or Readable?
Reply With Quote #11

Here's a nice coding style for the ternary operator I recently saw somewhere, can't remember where though.
PHP Code:
client_print(0print_chat"%s!",
    
thing
        
thing
        
thing2
            
thing3
                
thing4
                    
thing4
                    
thing5
                
thing3
            
thing2
); 
Pretty much equates to how you would indent your if/else structure.
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-24-2016 , 15:28   Re: [HELP] Fast or Readable?
Reply With Quote #12

Or maybe
PHP Code:
thing ?
   
thing2 
      
thing3 ?
         
thing4 :
             
thing5 
__________________

Last edited by Depresie; 09-24-2016 at 15:29.
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-25-2016 , 00:24   Re: [HELP] Fast or Readable?
Reply With Quote #13

Code:
client_print(0, print_chat, "%s!",     thing         ? thing         : thing2             ? thing3                 ? thing4                     ? thing4                     : thing5                 : thing3             : thing2         :thing           :thing4             thing5         thing4            thing3:        thng2:         thing6            thing7. );
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-25-2016 , 12:05   Re: [HELP] Fast or Readable?
Reply With Quote #14

Have fun debugging that mess if something doesn't work as expected.
__________________
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 19:37.


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