Saturday, May 30, 2009

Why I'm writing a blog

I'm a 39-year-old C++ computer programmer who likes to play chess (badly). My true love is my wife, but my obsession is sorting algorithms and implementations. Their inner workings fascinate me: it amazes me that there are so many different ways to "skin the cat". I collect sorting routines, compare them, test them, tweak them, and I like to write my own. I have collected literally hundreds of sorting routines, over the last ten years or so, and have written dozens more of my own.

I've decided to do a blog about the theory and practice of writing sorting routines (which will mostly focus on C++ implementations, because C++ is the language I know best, and because C++ gives me "generality" - via the use of features like templates - but lets me get "closer" to the hardware than do byte-code languages like C# and Java). And I want my own blog where "I'm in charge". If it's my blog I will get the last word. Sometimes the last word will have to be an admission I've been wrong all along, but I'm okay with that.

You'll find that my opinions about the relative performance of sorting routines will tend to be boringly conventional (Quicksort beats Mergesort beats Heapsort, duh!) but my opinions about the reasons will sometimes be a bit more controversial (e.g. Quicksort comfortably beats Mergesort if the order of merge is 3 or less, but because it requires less record movement, not because Quicksort makes more efficient use of the cache).

I'll include snippets of working C++ code in my posts, and I'll cover sorting algorithms and data structures that I don't like (for example, I think lists and trees both suck for sorting, but I'll still cover them). When I think an algorithm is a dog with fleas it's always because I couldn't find a way to tune it up. But, even if I start out thinking the algorithm is no good, I'll try to tune it. There are way too many comparison articles that say "X is faster than Y" and then "illustrate the point" by contrasting a tuned-up version of X with a tuned-down version of Y. I'll try to avoid doing that!

And, no, I have no idea what order I'm going to present things in! To get a coherent version of my blog you will have to... sort my posts. That will be "left as an exercise for the reader."

No comments:

Post a Comment