I had a general question that's come from comments on my answers from experienced users on the site, see User defined password at registration - registration email sends auto generated pass and Using jQuery to delete data stored in wp_options. After reading How To Answer, my understanding was that we should answer the specific question, rather than providing ready to go copy/paste code, not that the two are mutually exclusive.
In the ajax example, @brasofilo raised a very good point, the code will simply be copy/pasted, and the suggested edits from the three experienced users reflected that. But how far does that go? In the first example, the asker posted a question about sending a user selected password via email. The answer answers that question, but as @t31os pointed out, the code is inherently unsafe as it doesn't contain sanitization or even check that the correct form fields were filled out, much less a nonce check, etc. But how far does that go? Should I be creating the initial form for the asker as well? Am I presuming too much in assuming that most developers follow best practices with form submission, db interaction sanitization and any framework specific security considerations (I guess I am)?
I guess I could just use some guidance as to how much is too much or too little when answering the question. I'd like to be, "doing it right." Thanks for any input.