A few changes

I’ve just finished making a few changes to the code that runs this blog, and I’m rather happy with the results.

First, I took my own advice in the previous post and switched my custom pagination code with the PagedQuery class. It is beautiful code, and it does just what I want. I integrated it quickly and easily into my existing models, and I even created a custom Django tag to create the pagination control that appears at the bottom of the page.

Soon, I will make all of that work available on Google Code as a project called Commentable, a mixin class that allows any entity to have Comments associated with it.

Second, I integrated another great open source project from Google called Prettify. It is a JavaScript and CSS package that displays code blocks elegantly and with syntax highlighting. It is sensationally easy to integrate, and you’ll notice that difference if you look at some posts that contain code samples. You can find the project at: http://code.google.com/p/google-code-prettify/

Finally, I switched from the Dijit rich text editor to TinyMCE. I have worked with TinyMCE before; it is used in MyKidsLibrary. In addition to being very easy to integrate and much more light-weight than the corresponding widget from Dijit, it gave me some much-needed capabilities right our of the box that I just couldn’t figure out how to do otherwise. I’m certainly not interested in or inviting an open-source holy war, but I do believe that great code speaks for itself.

Looking back on the experience of making these changes over the past couple of days, I am reminded of how fun and viscerally rewarding it can be to write code and work with computers. Perhaps it is just an expression of who I am -- I’m sure that not everyone has the same feelings about this that I do -- but that in itself makes me grateful that I found this work, as I couldn't enjoy anything kind of work more.