The nitty-gritty details of code implementation are important too, but you can't get those without a full example. (And, unfortunately, a lot of examples don't have enough details worked out; they show too clinical a view of code, without really giving a realistic view of the messiness needed to handle things properly.)
To avoid encouraging cargo-cult programming, I recommend giving explanations before the code that outline the approach, and perhaps comments within the code itself. Copy and paste is not the (main*) problem; lack of understanding is. Fighting that is therefore the main goal.
I have an auto-comment for non-trivial code-only answers, in fact, which goes like this:
Could you please [edit] in an explanation of why this code answers the question? Code-only answers are [discouraged](http://meta.stackexchange.com/q/148272), because they don't teach the solution.
(Unlike some, I do not consider code-only answers ripe for deletion in most cases. They are of some value, just not as much.)
*It is a problem, however, since C&P is a lot harder to version properly in synch, especially when you have years-old articles floating around the web.