Raised This Month: $ Target: $400
 0% 

[SOLVED] How I can optimize this code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 10-14-2014 , 09:33   Re: [HELP] How I can optimize this code?
Reply With Quote #1

Quote:
Originally Posted by fysiks View Post
@Klippy, just remember that that code is technically less efficient than simply implementing a switch. However, that is basically what I said for my alternative approach that is more flexible and is definitely worth it.
You can (and should) also optimize code for readability and maintainability, so the almost non-existant performance improvement that a switch might provide is not really worth the tradeoff.
__________________
In Flames we trust!
Nextra is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-14-2014 , 13:02   Re: [HELP] How I can optimize this code?
Reply With Quote #2

Quote:
Originally Posted by Nextra View Post
You can (and should) also optimize code for readability and maintainability, so the almost non-existant performance improvement that a switch might provide is not really worth the tradeoff.
Hence why I said it "is definitely worth it".
__________________
fysiks is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 10-14-2014 , 13:40   Re: [HELP] How I can optimize this code?
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Hence why I said it "is definitely worth it".
I know that you understand and that you don't advise going the switch route. I just felt that I had to stress this a little more.
__________________
In Flames we trust!
Nextra 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:38.


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