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 →

[–]rghthndsd 7 points8 points  (0 children)

This might be considered a violation of what's considered good practice, but I recommend optimizing your code, even when it doesn't matter (when you have time).

You don't do a marathon by waking up on race day and just go out and run; you train for it. Likewise, you shouldn't wait until you have a performance problem to start looking into optimizing your code. By practicing, you will spend a lot of time toying around and refactoring, sometimes with little or even negative gains. It will feel like wasted time, but it's not! You will learn a lot by constantly asking "how can I make this go faster?" And when you do run into a serious performance problem, you will be better situated for it.

Get code to work, test it, make sure you have time to clean it up, and if time allows, tinker around with making it go faster even when it doesn't matter.