Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

When asking a question in general, should I give the overal functionality of the program and the code first and then ask the question or vice versa?

P.S. Please feel free to change the title to be more concise and relevant to my question for others use.

share|improve this question
You should post a SSCCE, not all of your code. I would format with your question at the top, then a concise statement of your problem along with what you've tried, and then the minimum amount of code necessary to reproduce or illustrate your problem or question. Also, spend time on formatting the question so it's not just a wall of text. No one likes a wall of text – Ghost Aug 15 '12 at 23:04

We may be smart and talented on SO, but the fundamental part of the problem solving process is the ability to break it down for even the lowliest of scripters.

Think of it this way: The problem you're solving is the meat and potatoes. The code is just gravy.

You would want to express your question in such a way that, without code, we have our own ideas of how this algorithm should be implemented. You add your code to satisfy the notion of previous work, and to pinpoint what your confusion is - it could be an obscure exception being thrown, or the results aren't what you expect them to be.

The code must be substantial enough to be run by any passer-by in fifteen seconds or less (hence an SSCCE), but the key thing is that your question be detailed enough that, in 2 minutes or less of skimming, we can understand what you're trying to solve and where you're stuck.

To specifically address the question, my preferred order is a description of the problem with just enough detail, and then an SSCCE to illustrate what you've attempted, and what you're struggling with. This would convey clarity of intent and clarity of question. Seeing code first kind of makes my eyes glaze over; my attention isn't immediately captured by seeing int**** mtx;, and attention spans are what you're mostly battling against. Make your initial communication point count!

share|improve this answer
tl;dr: Provide a brief description of the problem and code that reproduces the problem. Write with clarity! – Robert Harvey Aug 15 '12 at 23:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .