We wrote special code at Stack Overflow that tries to detect unformatted source code (there are a lot of unusual [
and {
characters per line, etc) and blocks the post until the user formats it. I believe there has been some discussion of such a plugin for Discourse, it wouldn’t be terribly hard to write.
Then users started posting screenshots of code …