"If I'm writing application x and function y is ballsing up, do you want me to tell you what the app is for, what platform it's on, what language, who it's for, etc., or should I just post the code for function y?"
I don't want "function y", or any part of your application. What I want to see is a short, clean, stand-alone piece of code that I can run to observe the problem.
I also want to know what the code is supposed to do, and what it does for you (since that might not always be what it does for me).
If your code requires some data to demonstrate the problem, please provide the data too, in whatever format is most easily copied.
I don't necessarily need the standard boilerplate for your language (you don't have to include the <?php
before every piece of PHP code, for example, and I'm perfectly capable of wrapping C code inside int main (int argc, char *argv[]) { ... }
), but I'd rather not deal with something that requires a bunch of vaguely described and hard-to-install libraries or frameworks just to run.
Where applicable, a JSFiddle / SQLFiddle / Ideone / CodePad demo is always nice. But keep it simple, please! Just because you can paste 500 lines of code into Ideone doesn't mean anyone wants to read it.
The main exception to "just a simple stand-alone example, please" is when the first reaction I have, upon seeing your question, is "why would you want to do that in the first place?" In that case, I do want to see some explanation of what you're really trying to accomplish, so that I can tell if you're having an X/Y problem.
Similarly, if (something very much like) your question has been asked before, but the earlier answers (or the standard answer to problems of that type) don't work for you, I do want to hear why, so that I can tell what alternative solutions might work.
In either case, don't go into too much detail, at least unless specifically asked. A simple "the reason why I want to write a text editor in brainf*ck is because (it's a challenge / my boss told me to / I accidentally changed my shell to bf.exe / etc.)" will do. You'll probably still get answers questioning your choice and suggesting alternative methods (that's what X/Y problems are about), but at least they'll be informed suggestions.