The idea for this talk came with digging in to web security after last winter's Rails vulnerabilities. Whole categories of vulnerabilities are due to not properly escaping inputs, at least that is the common wisdom : ESCAPE ALL THE THINGS.
Fact is that having to do escaping manually will always be error prone. Using SafeBuffer to automatically escape in views/templates might seem like a good idea, but it's not addressing the structural problem : that we're manipulating structured data (like a DOM) as plain text.
It can be quite an epiphany to look at it from that angle. Plain text representations should be considered a serialization format. It is not sensible to write that by hand. It's more complex than is commonly acknowledged. What if you have a URL inside CSS inside JSON inside HTML?