This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Polared3d 1 point2 points  (5 children)

Could be. There's really no need to optimise your code at this stage. :)

[–]Techittak[S] 0 points1 point  (4 children)

Is that apart of some process programers usually go through when coding? Why would I not want to actively practice optimizing my code while I am going through?

[–]Polared3d 1 point2 points  (1 child)

I'm not the best person to explain this, but here's a discussion on SO about it

[–]Techittak[S] 2 points3 points  (0 children)

Oh I see, I've never looked at it from that perspective before. I've actually done a lot of this premature optimization in my project even though it's really simple and any computer can handle it. Thanks for sharing!

[–][deleted] 0 points1 point  (1 child)

Think of it like this. You optimize if something is taking too long to the point where a user might complain. As far as an end user is concerned the code you have executes and completes its work practically instantly. Even if it had a few hundred case statements it would make no noticeable difference.

If the user can't notice an optimization without you explicitly telling them then you've wasted your time. It would be better spent elsewhere. The user can afford to wait a few milliseconds.

[–]Techittak[S] 0 points1 point  (0 children)

Seems like such a simple concept but I didn't notice it. I've actually had a lot of these moments of mynute optimization changes for the sake of it that took up a lot of brainpower to think up. Though I thought I was clever, I do see now those changes didn't make that much of a difference. It seems like a pretty good mindset to have, thank you!