kludge on kludge
Monday, April 5 2010
I spent much of the day on web development for one of my more speculative projects. As always when working on projects of dubious financial utility, I used it as an excuse to further flesh out some generic functions I can use in any projects. I have a function called GenericForm which, based on the content of several arrays, spits out an HTML form. That's a very useful bit of functionality, because forms can be a pain to lay out and modify, and they look like shit unless you take the pains to make them attractive. Once I figure out how to display a form the way I want it, I just want to apply that to all forms on a site. I like to distill out the essence of what makes one thing (in this case, a form) different from all other instances of that thing and put it in some handy single place to be quickly modified. The problem with forms, though, is that they are essentially tabular in shape, and aside from extremely uniform instances of them, the differences between them can be hard to describe. I'm not the only one dealing with this problem. When making admin tools in Drupal, for example, you end up tolerating a lot less-than-perfect forms, because the alternatives are just too hard to pull off. But in today's project, the complexity of the form demanded that I include grouping among form elements, and there needed to be a way to express this in the form's distilled essence. I came up with a system that worked, but I'm not perfectly happy with it. As it stands now, GenericForm is becoming a kludge stacked ontop of another kludge nearly 300 lines long, and in this Universe you have to go down several turtles before you reach a solid foundation. I don't even know if refactoring this mess is possible. It's a terrible mess, but it's incredibly useful and it works, so I'll probably learn to live with it.
I took a break at some point to climb a Pitch Pine tree to the north west of the house. Using a ladder to get up to its lower branches, I found it relatively easy to climb all the way to the top (where my head was even with the topmost needles of the canopy, about 35 feet above ground). From there I could see a high ridge of the Catskills north of Woodstock, a sight otherwise invisible from around the house (even from the solar deck).
Gretchen returned from errands in town with two delightful surprises: Indian takeaway from the Uptown Indian restaurant and news that we'd be getting a nearly $4000 refund for our taxes this year. Gretchen had told the guys at the restaurant to spice up my vegetable jalfrezi like how they do in Bangladesh, and they hadn't disappointed. That stuff was on fire! The great thing about chemical heat that is cooked into the food (or allowed to stew in it during a car drive home) is that its presence is noticeably less superficial. It's a heat that continues into the center of chunks.
For linking purposes this article's URL is:feedback
previous | next