Here is the SO question that inspired me to bring this up to meta and hear your opinions.
The OP gets a rather generic and obvious error message but doesn't understand what is causing it... He/She thinks the code is doing something different but in reality it's not.
There have been multiple answers but we're talking just about 2:
I think that if we combined the two answers (explanation + code) that would just be super awesome, but this is not what happened - intentionally, at least from me.
This is how it works from my perspective:
I clearly don't have or don't want to spend my time rewriting someone else's hundred lines of code in such a localized question. It's too lengthy and there are way too many sections of the code that could be improved. I don't want to just copy-paste those hundreds of lines while fixing one for loop or an if-else statement... When I am posting an answer that includes some code, I want to make sure all sections of it are improved, not just a single line that caused the error surrounded by hundreds of irrelevant lines of code... Always thought that's the whole point of a Minimal, Complete, and Verifiable example? Reusability + thinking of future visitors.
I hope you see the picture because now...
I guess I was a bit irritated when I noticed that someone else got the 100 points from the bounty while I believed that my answer "got it right" but on the other hand all the upvotes make up for it so it's not really that big of a deal...
My other argument is that any future visitor searching for the problem will be in his own script, localized and customized to his own needs, under different circumstances and I believe that visitor would benefit more from the explanation of the cause of the error rather than a localized code answer.
So, do I tell the OP what is causing the error (teaching to fish) or just dump a working code and say someone else can explain to you what caused it?