Log in

No account? Create an account
entries friends calendar profile Elf Sternberg's Pendorwright Projects Previous Previous Next Next
Unrealistic Expectations - Elf M. Sternberg
Unrealistic Expectations
I don't know why I do this to myself.

I had a brainstorm yesterday morning, and set aside about four hours to figuring it out. The idea was simple: I wanted an RSS reader like Liferea, which is my reader of choice, but which had not just the generic GTK-based front end, but a standard REST-based front-end. I also wanted better performance; Liferea is nicely written and multi-threaded, but I thought that if I separated the front-end from the back-end, and changed the back-end to an event-driven model, then I could make both work independently.

And then I thought, if I did that, then I could write a pubsub handler whereby front-ends could receive messages, and multiple front-ends would receive all feed and subscription updates as they happened.

After four hours of straight programming, I had a working script for loading the feedlist in OPML-XML format. I grumped. That was it? After four hours, all I had was a single intake handler? Where was the event loop, and the feed handler?

And then I realized: I'm working with a technology I haven't seen in 12 years (SAX) and a low level I don't usually indulge in, and because it's all the rage in event-driven programming, I was writing the OPML wrapper in language I've never actually written in before, Node. SAX has matured a lot, and when used with the enclosured callbacks of Node makes for a very viable technology. It took me a while to figure out how to express the DTD in SAX, and then how to write the closure properly so that I could get the data back out. By the end of the session I was deriving and successfully walking a JSON tree of objects, looking at each object's respective title and so forth.

There was a lot left to do: error handling for corrupt OPML for one. Distinguishing between standard OPML, Livejournal and AmphetaDesk's broken but survivable OPML (yo, LJ, AD: XML is cAsE sEnSiTiVe), that kind of thing. Exporting the document. Eventually, transferring the document to an internal feed/subscription and running that damned feed.

And that's just the OPML handler. Eventually, I have to write RSS, Atom, CDF, and PIE parsers, but I have the DTDs for those already. Once I write one, it's a template for the rest. Once I have all of them, a couple of output handlers for JSON and a generic RSS format should be trivial.

But mastering even that much is pretty damned impressive. Why do I have such unrealistic expectations of my output?

Current Mood: frustrated frustrated

2 comments or Leave a comment
pandakahn From: pandakahn Date: February 7th, 2011 09:13 am (UTC) (Link)

The awesomeness that is you!

I had to re-read this twice to begin to fully understand how much of it I didn't understand. The fact that you did what you did in four hours is, to me, awe inspiring.

I run Ubuntu on most of my boxes as a secondary OS. once you have this up and running I would love to be able to try it out.

Code Monkeys: they are just awesome!

norincraft From: norincraft Date: February 8th, 2011 04:13 am (UTC) (Link)
Ummm ... because you're good at it?


How 'bout this: because you secretly know that most the rest of us know just barely what you're talking about and actually gloating?

{crickets chirping}

Because you have high expectations of yourself?

I got nuttin.
2 comments or Leave a comment