Should You Really Be Optimizing Right Now?
Posted on | May 22, 2009 | 5 Comments
C# is the language that is keeping the lights on right now. I had a conversation with a fellow programmer about refactoring and optimizing code. C# is compiled by a very refined compiler. I am hugely generalizing the process here, but the compiler can determine your intent and provide output based on that. This means you could write a method ten different ways and still produce the same output from the compiler. What does this mean? Let’s say I originally wrote a method and was happy, then I learn about generics. I rewrite the method to use generics. Rinse and repeat and eight times later, the compiler still produces the same output. Maybe my code is more readable after the ten refactors, or maybe not.
I wanted to illustrate the unecessary effort we sometimes fall victim to. A more wholestic approach would be this. Compose a solution to a problem, run your solution under some sort of load test, and analyze the results. Your analysis should show the inefficiencies. Then you target those areas for improvement.
Comments
5 Responses to “Should You Really Be Optimizing Right Now?”
Leave a Reply
March 4th, 2010 @ 10:04 am
I enjoyed this very much! Just charming! Your composing manner is pleasing and the way you managed the subject with grace is notable. I am intrigued, I presume you are an expert on this subject. I am subscribing to your updates from now on.
April 4th, 2010 @ 5:05 pm
This is my subsequent visit to your blog. We are starting up a brand new move within the similar niche as this site. Your weblog provided us significant information and facts to work with. You’ve accomplished a wonderful job.
August 15th, 2010 @ 11:34 pm
Thank you. I am glad the information I provided was helpful.
August 31st, 2010 @ 9:32 am
was wondering..can I use some of your post on my site if I give you a backlink? ; )
September 1st, 2010 @ 7:20 am
Yes, please feel free. I only ask that you give me credit for any post you use.