It would be great if Stack Overflow, and other code-centric Stack Exchange sites, used Behave.js for the main question/answer textareas.
Let me address a couple concerns:
it's not clear that the code fencing support could be made to be consistent with markdown
fence option is disabled by default, which means that the IDE behaviors get applied to all the text in the textarea, not just the text within a “fence” (e.g.
```). We’ve been using Behave.js on all of the documentation on http://buildwithcraft.com/docs, most of which isn’t code, and we’ve left the
fence option set to
false. I can say from experience that the IDE behaviors do not get in the way when you’re not writing code. In fact if anything they make typing normal text even easier. So I’d recommend that option is just left at
false, so this is a non-issue.
most code on SO comes from people pasting in existing code, not writing new code
That’s probably true, but Behave.js even makes that experience better, since you generally aren’t pasting in code that already has the correct indentation. With Behave.js you can select all the code you just pasted in, and type Tab to increase the indentation, or Shift + Tab to decrease it, all at once. Saves a lot of time and frustration!