The joy of productivity

What time I had this weekend that was not spent ferrying children to-and-fro, maintaining my yard, grilling steaks for Mother's Day dinner and otherwise acting hyper-kinetic was spent adding discussion forums to My Kid's Library.  I had managed to put together the data models during the week, but other than that, I was starting from virtually zero code when I began to work on the new feature on Friday afternoon.

I worked whenever I could sit down at my computer for five minutes.  I would implement a method in a controller here, I would slap together HTML there...I'm not sure that I could accurately gauge how much total time I spent working on it, but it couldn't have amounted to more than four hours.  However, as of Monday morning, I have fully-functional, reasonably-attractive, usable discussion forums.  Don't go looking for them quite yet on the public site, as the code changes haven't been published, but they will be quite soon.

That I was able to create a significant amount of functionality in very limited time and with a pleasingly-small amount of code is a testament to Ruby on Rails.  It does what it does well. Very well.  It continues to impress and surprise me even now, a year-or-more since I started using it to develop a live, working web site.  I still have a little bit of the happy buzz that comes along with completing a major feature in a piece of software, and that feeling comes in the wake of a couple of days that didn't see me sitting at the computer for any extended length of time at all.  Crazy.  Awesome.

Thanks for the buzz, Rails.


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.