Sunday, August 17, 2014

I really do hate computers

So my List of Songs not in 4/4 is up on the internet, which is exciting.  I put it up a week or two ago, having recovered all of the data from my old site, dating back to 2004.  In order to just get the darned thing back up this century, in my new, recoded-from-scratch Django-based website, I had to bump a lot of features down to post-launch.  Since there are 568 songs, I thought that filtering (which kindof includes searching) was the next most important feature.  Here's the before:

Here's the after:
In case you don't see the difference, it's the stuff at the bottom.  Now you can see just the songs in 3/4, or just the songs by Queen, or by anyone with "uee" in their name (at least three bands; can you name them?).  No big deal, right?  I mean, I picked the Django framework because it's one of the best, most actively developed and most advanced web application frameworks.  I was able to get my data in a nice pretty table, with alternate-row shading and pagination and sorting, and that (adding the pretty formatting and sorting) only took about four hours over two days to, in classic computer science fashion, figure out a few lines of code to save me hundreds of lines of code.  Well, filtering was a lot worse.  Bottom line: 10 hours over the last week.  Not to solve the problem of filtering, but just to figure out how to get a pre-existing filtering module to actually work.

There are three or four different ways in Django to simply and easily filter your table, and none of them is fully documented, none of them works readily with other things like pagination and sorting, and all of them are very leaky abstractions.  The typical quality of documentation is exactly where it was when I stopped contributing heavily to open source back in 2003: written by people who understand 100% of the problem, and believe they are providing 90-100% of the solution, but actually including only about 60% of the solution.  Some kind soul figured out how to get three different pre-existing features: sorting, filtering, and looking pretty, to work together, and it took me only 10 hours to figure out how to get that solution to work.  And it still looks terrible.  Yay? 

This was the first time since I really dug in to this project that I considered abandoning Django for something else but when I googled for ruby on rails table sort filter paginate IActually, I didn't see this before.  Hmm, that example actually does exactly what I want to do, and it's fully documented, and it looks decent, and it's from 2011.  Maybe when I wake up in the morning I'll switch platforms and throw out 80 hours of suffering.

No comments :

Post a Comment