Jan 30 2008

Demons in DOM

Tag: Computer Science, ProgrammingAdam Wright @ 1:38 pm

At the moment, I’m spending spare moments collecting and collating idiomatic failures in Javascript (specifically, failures of DOM manipulation in Javascript). This is, alas, proving harder than I expected – bug database trawling is about as fun as it sounds and, more importantly, the bug databases don’t keep track of developmental bugs.

By idiomatic failures, I’m referring to common mistakes and patterns that cause errors. Suitable examples from other languages would be

  • In C, failing to account for the null string terminator
  • Buffer overruns, in C and C++
  • Off by one errors in pretty much every language
  • With C++, delete’ing a new[]’d resource
  • In PHP and many other scripting languages, failing to account for the weakly typed comparisons (so you forget that 0, null and the empty string are treated as semantically the same under comparison, but are distinct in your program logic).

These are the building blocks of certain types of program failure –often, when debugging, one of these type of error is the cause.

Of course, I’ve run into these many times myself, but that doesn’t really say much about the commonality of the problem; I may be a particularly poor programmer. So, I’ve been spelunking around bug databases for long running open source projects (i.e. the Javascript libraries behind Ruby on Rails); this is proving somewhat fruitful, but it’s a statistically invalid sample. As mentioned, the bug databases only tend to get populated by bugs in release versions, and then only the bugs that people have bothered to report. If a developer finds a bug whilst he’s developing, these are often not added – even if it took days to track down. Moreover, if they find a bug in a release version themselves, they often quietly fix it. Bugs that only occur rarely and are not repeatable are added almost never.

In a way, this is quite good – the failures I’m seeing are the ones that escaped testing, escaped the eyes of the developers, yet blew up in a users face. These are the hard to see bugs – the most annoying of the species. On the other side, this is quite bad – I miss a huge subset of bugs that fall into my class of interest.

Of course, these types of problems could be considered language defects – stupid mis-features that bite people again and again specifically because they are so artificial. After I have a relatively complete map of these failures, I’m going to move onto logical failures and failures of design that are common within Javascript/DOM – i.e. conceptual black holes that people are repeatedly sucked into, the actual failures of programmers.


Jan 19 2008

Code update

Tag: MetapostAdam Wright @ 9:52 pm

As another preparatory step, the code base for this site has been replaced by the most recent Wordpress release (10,000 versions newer than my last, give or take a few). The shiny new theme is provided free by Tommaso Baldovino; I have the graphic design skills of a blind snail, so the provisioning of free work by talented designers is a true blessing.

Comments are now being checked by the built-in Wordpress Akismet spam checking engine. If anyone has any trouble, just drop me a line.


Jan 16 2008

Cleanup

Tag: MetapostAdam Wright @ 8:10 pm

I’ve been expunging some site noise recently; defective posts that link to things that never happened. I’ve left the vast majority of the content (even when I really dislike what I wrote), but I wanted to remove the temporal references that point to nowhere (”I’ll post this then”, but didn’t).

A good education in what sort of posts don’t work, and preparation for writing again!


Jan 13 2008

Showing off

Tag: UncategorizedAdam Wright @ 11:15 pm



Showing off

Originally uploaded by archgrove

Insanely busy, but not dead. Here’s a photo from last summer. When I can spare the editing time, I’ll distill some of my academic writing into posts here.