i think i want a monster

August 19, 2004 under ChrisBellini.com

I’m tempted to move this site o’ mine from the free web host that is Tripod to a proper host. I’d like to be able to actually use this site as a showcase. Perhaps a place where I can post pictures and people all over the world can comment on them. I’d probably use a language like PHP with a database like mySQL; two things not available from Tripod. Or perhaps I could develop a better way to manage the site content. The possibilities would be endless. Well, more endless than now. Tripod provides very little in the way of development tools. I’ve been leaning towards Monster Hosting, based out of Surrey, BC. The price is awesome and the features are plentiful. They even offer Python support.

Python is a wicked-kewl scripting language that I’ve been learning here and there. Syntactically, it’s designed with the programmer in mind and it’s not C-like like everything else is. Take an implementation of the Insertion Sort algorithm to sort an array of integers, for example. I’m picking on Insertion Sort since I had to implement a specialized version of it for a project at work and it’s on my brain at the time. Here’s a straight-up C/C++ (no STL vector class or anythin’) implementation of Insertion Sort that I wrote for my Data Structures and Algorithms course in university:


void insertion_sort(int *array, int min, int max)
{
int i, j, key;


for(i = min; i < = max; i++)
{
key = array[i];
j = i;

while ((j > 0) && (array[j - 1] > key))
{
array[j] = array[j - 1];
j--;
}
array[j] = key;
}
return;
}

Uh huh. Now look at how I did it with Python:


def insertion_sort(array, min, max):
for i in range(min, max):
key = array[i]
j = i
while j > 0 and array[j - 1] > key:
array[j] = array[j - 1]
j = j - 1
array[j] = key

Without going into the gory details for those who could care less about the finer points of computer programming, compared to my C/C++ version, my Python version is visually mint!

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>