In my Extreme Object-Oriented Ruby talk at Full Stack Fest there was a bug in the live coding at around 29 minutes. When I was running the code it was failing with undefined method 'then' for false:FalseClass
.
The source of the bug is quite subtle. The boolean operator starts with:
If.new(threat_level == Four)
That looks like it should work, but ten minutes earlier (when I'd been writing the comparisons for numbers) I forgot to save the file before moving on. The live evaluation worked when I was looking at numbers because it copies the content from my editor, runs it through xmpfilter and then puts the result back into the editor, so it doesn't require me to save the file. But later on when I was using the number for this comparison it became a problem. The comparison fell back to Ruby's built-in behaviour for ==
which, in this case, was returning Ruby's built in false
rather than an instance of the False
class that I had written.