NIO and Servlets

Interesting article from IBM about how you might implement a servlet container using non-blocking IO, by essentially layering a non-blocking demultiplexer on top of the standard servlet input/output stream stuff.

Pleasingly the article vindicates my position during a recent pub conversation with Jon where I asserted that it should be possible to use NIO to write a better servlet container, but due to alcoholic impairment I was unable to articulate precisely how.

Great minds and photoblogs

Looks like Alan and I have had the same idea at roughly the same time.

I’ve been wanting to try photoblogging for a while, and more generally, post about stuff that is decidedly not work related. Rather than dilute this one with non-techie stuff I think I’m going to start a second one that I can muck about with a bit more.

My leanings to date are to stick with MoveableType and probably use some or all of the following plugins:

Been having trouble getting ImageMagick set up on my hosted server, but have managed to work around that so far by using it locally under cygwin and processing images manually. ImageMagick is highly scriptable (including Ruby!) so it should be pretty easy to build an automated image publishing workflow even if I can’t get it working on my server.

Defect Driven Development

Credit for the title of this post goes to a remark by JB Rainsberger in the extremeprogramming yahoo group.

The pertinent line was something like, “I pretend that my program starts as an infinite collection of defects”.

I like this concept because it discourages the creation of separate story queues and bug queues, and encourages driving out the design through the addition of failing tests.

Each test added will constrain the defect-space of the program, until all the requirements have been satisfied by tests and all the tests are passing. At which point the defect-space and functionality-space of the application are separate and distinct. There’s probably some clever comment about set theory and venn diagrams I could make here, but I’m not smart enough to think of one.

Virtual vs Final

Posted to the Artima forum following this interview with Anders Hejlsberg about the ‘virtual’ keyword in C# compared to Java’s ‘final’

By making methods final by default, and having to explicitly state which ones can be overridden, you are forcing developers to try and anticipate all possible future uses of the code they write.

It encourages a sort of protectionist attitude that says ‘You’re not smart enough to understand how my code works, so I’m going to only let you override the bits that I choose to allow’.

I write code to be useful, and if someone sees a use for it that I didn’t anticipate, by overriding a method, then thats a good thing and should be lauded, not repressed.

Spam, evolved

I’ve started received bayesian-busting spam on a regular basis. Typified by large blocks of surreally random words, they strive to reduce their spam-quotient by diluting the trigger words with large amounts of non-spam words. As a colleague commented, it does tend to reduce the comprehensibility of the marketing message somewhat, and can give rise to inadvertent humour, with such gems as:

‘cohesively delineates Krebs spaceships’
‘Amiga itself surprises paramount degree’
‘television resurrects evolute dictionary skeletons’
‘codifying beagles Janeiro snack rhythm’

I’m not really interested in buying herbal viagra, but I gotta get me one of those cohesive Kreb spaceship delineators. They sound cool.