How important is handling compiler errors prior to posting questions when there is a misunderstanding on how to structure code? Aside from consulting literature and performing additional tests, are there other good ways to improve my code blocks for my questions prior to posting?
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
If you post code that has compiler errors that aren't trivial, and your question isn't related to those errors, then you aren't posting a clear question; we can't really understand what you're trying to do and it's more than likely Not A Real Question.
Of course, if your question is "I get this compiler error", then it will be closed as Too Localized, as the question is specifically about that error, and there are a gazillion ways to generally create any compiler error (all different examples), none of which are helpful to other people as they are specific to your code.
It's forgivable, however, if the compiler errors are trivial (missing a semi-colon in C#, for example) and not the crux of the question, and even with the errors it's easy to determine what the person is actually asking and trying to do. In those cases, I'd advise that people should edit the question to fix these errors with an edit, and focus on the actual, obvious problem instead of being pedantic and voting to close.
Basically, if the effort to fix the post is the same as it is to cast a close vote, then fix the post. You're just creating more work for everyone by (others might pile on, or not, you're not really making the site better, etc).