Douglas Crockford
121
Crockford: I like them. I was disappointed that Eiffel was not the winner in
the object-oriented-language contest; that C++ won instead. I thought Eiffel
was a much more interesting language and I liked the
precondition/postcondition contract stuff that it did. I would like to see that
built into my language, whatever language I’m using, but that’s another one
of those ideas that hasn’t really caught on.
Seibel: What’s the worst bug you ever had to track down?
Crockford: It would’ve been a real-time bug. It might’ve been in a video
game. We’ve got interrupts popping all over the place, and no memory
management at all, and the program suddenly goes away and you don’t
know why. That kind of stuff is really hard. And generally there wouldn’t be
a debugger around either.
At Basic Four we had developed a word-processing terminal. It was a Z80-
based terminal with a full-page display and 64K, which wasn’t nearly enough
memory for a display that big. And it had a local network connection to our
server where it would send up the pages.
And we had this problem where every once in a while the screen would go
blank. We had this architecture in which we had a line of text and then it
would have a stop code, and then the address of the next line, and a little
DMA processor that would follow those links. And at some point a link
would go away—there was some race that was happening.
From our perspective, looking at it logically, all of the links were good, but
we hadn’t considered the real-time interaction with the DMA processor,
which might not be looking at memory at the same time that we were. I just
puzzled it out. I remember I was working at home that day and I was on the
phone with my team and suddenly the lightbulb went on; I knew what the
problem was and I was able to tell them how to fix it and we never had that
problem again.
In my experience, the worst bugs are the real-time bugs, which have to do
with interactions with multiple threads. My approach to those bugs is to
avoid making them. So I don’t like threads. I think threads are an atrocious
programming model. They’re an occasionally necessarily evil, but they’re not
necessary for most of the things we use threads for.