Optimizing Code and Complaints About College

December 5, 2007

I just read an interesting blog post at http://hisitech.wordpress.com/2007/12/02/40-tips-for-optimizing-your-php-code/ on tips for optimizing PHP code and it made me realize how shielded I am from some of these problems. I wonder where I can go to find more information on optimizing code. It seems like this would be something that they would at least start to tell us in college but I can only recall a single class where we talked about the differences between the straight assembly code and the C++ for a single for loop. The C++ code ended up being four times larger but took four times less to write. It seems that given how fast modern computers are it doesn’t matter how optimized most small applications written for class assignments but it does matter with applications that are more complicated.

This just ties into my problem with “assignment” programs being “one off” applications that are never revisited. I know a lot of people in my classes, both in high school and college, that didn’t have any structure or comments in their code so when they needed help it took 20 minutes just to figure out what was going on. I write a lot of these one off applications mostly in Perl when I need to import data or convert the data into a different format but usually I plan at least the basics of what needs to happen. Most of the “assignment” programs aren’t planned out in advance and people plan only for the requirement they are looking at on the page. I think we would be much better off creating some kind of long term assignment that tied all the projects into one so if it is planning out in advance it will be easier (I would like some challenge). I just have to wonder what happens when we have to enter the “real” world and this messy coders start to work on mission critical applications. I guess I don’t have to wonder any more about some of the crappy programs that I have seen.