I have seen so many people on Stack Overflow (mostly those sloppy people who make a lot of grammatical/spelling mistakes) putting a space before punctuation, especially before a question mark. Is this a widely spread habit shared by programmers?
In some languages, like French, it is required and carried over into English by some users.
I am not aware of any research into this topic. One can speculate it comes from the use of command-line interfaces where parameters are separated by spaces. Forgetting to separate by a space leads to angry error messages and the anxiety this causes carries over into written English.
Quoted from about.com
Two-part punctuation marks In French
a space is required both before and after all two- (or more) part punctuation marks and symbols, including : ; « » ! ? % $ #
I occasionally add a space before punctuation to avoid confusion. For example, "I dislike String#upcase!, but I really like String#upcase !".
I'd say it's not so much common with programmers, but any user generated content on the Internet, especially that written by idiots. You'd probably see it with YouTube comments as well. I asked a similar question on Japanese Language and Usage: Is Japanese that lacks proofreading likely to contain bad spelling or grammar?.
Bad English must be chotto muzukashii when you yourself have put a fair amount of effort into learning the language, ne?