Posted on May 28, 2009

Premature Optimization Is the Root of All Evil

…so says the famous quote, my current mantra.  This leads to my primary mission (or possibly, it would be more appropriate to call this my Prime Directive) is to code and get it all out. Brainstorm in code quicker and faster.

I have this extremely bad habit of writing 10 lines of code before shelling out the rest of the day learning how to improve these lines in R.  Yes, I learn a lot through the process, but graduate students are responsible for more than just learning. Sometimes, there are those that actually have no interest in what I have learned but only my results.

This idea is nothing new to me, but this post is an attempt to enforce a turning of a new leaf. It was ridiculous for me to waste the previous hour intending to optimize TWO lines of code! I cannot and will not do this anymore. Those two lines of code were not important enough to waste that much time.  Before my bedtime, my whiteboard may be plastered with a repetition of “I will refactor my code later and not now.”  Unless the code is being published, procrastinated optimization is far better than procrastinated results.

Am I alone in this endeavor?