Programmers constantly deal with two fundamental questions: "What?" and "How?". "What?" describes a result.. the output from some process. "How?" describes the process itself.

Start from there.

When you get answers of the "use {solution X}" variety, it's reasonably certain your question began with the word "How", and that you didn't put any constraints on the set of tools you consider acceptable for solving the problem. You've asked people to describe a process that will produce some result, and that's what they've done.

When you get questions that solve the wrong problem, it's a sign that your "What?" might not have been clear. You probably left the result itself open to interpretation, and someone interpreted the terms differently than you did.

(As an aside, "How?" and "What?" are analytical questions. They encourage people to break something down into smaller pieces. "Why?" is an abstracting question. It encourages people to wrap lots of details up in a nice, tidy summary. I once had a moment of Zen perfection when a girlfriend grumpily asked, "Why do you always feel like you have to explain things?")

To make matters more fun, the question "What?" has at least two meaningful layers of abstraction in programming. The low-level abstraction is a dataflow diagram.. What do you put into the program, and what comes out? The high-level abstraction is a use case analysis.. What problem does the user have that the program is supposed to solve?

Then there's a certain amount of "How?" just in turning the use cases into a dataflow.

I once made a fairly healthy chunk of cash consulting to a company which was having major performance issues with a database-backed program, for instance. They needed to be able to handle 100K+ hits in an 8-hour period, but the program they had bottlenecked at about 12 hits per second. They hired me to optimize their table structure, tweak SQL queries, and so on. I spent 15 minutes profiling the bottleneck, discovered that most of the bottleneck was network and database latency, and wrote a replacement storage system using flat-files that profiled 200x faster. The use-case was that they wanted to store a user's information. Their implicit "How?" was that the data should be stored in a database on a remote server, under conditions where the connection latency amortized very badly.

So, if your question doesn't have:

  1. A use-case statement (what good does the user get out of this?),
  2. Some very basic and abstract dataflow (broadly speaking, what goes in and what comes out?),
  3. Some constraints on the toolset used to solve the problem,
  4. And a rough list of performance priorities (speed trumps readability, or vice versa.. lowest possible maintenance comes first.. must offer flexibility for future growth)

then there are just too many free variables to expect the discussion to be focused.

More to the point, if you can't slot your question into one of these pigeonholes:

then it's probably a good idea to sit back and figure out exactly what kind of question you're trying to ask.


In reply to Re: How to ask questions? by mstone
in thread How to ask questions? by Eyck

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.