Help!

 

Getting help here and on StackOverflow and other help sites…

 

Creating a Question That Is Likely To Be Answered

whisper There are a few techniques that make for a question that is likely to be answered quickly and well. While none of this is a surprise, take a look at the questions that are posted, most don’t follow these simple guidelines:

Summarize your question in the topic

Most folks are more likely to open a question with the topic “How Do I sort a column in a datagrid” than one with the topic “Help, Urgent!” even though the latter may, in fact, be more urgent

Be Brief, Be Precise

A long rambling message whose point is hard to fathom is hard to answer.

Write Down the Exception or Error Message

It is far easier to help someone if they way “when I click on the button the second time I get a an exception saying that I’ve tried to access a null object,” than it is to help someone who writes “Sometimes my program blows up and I get an error.”

Provide An Example

The single most effective thing you can do to get help is to write the smallest and simplest example that shows the problem. It should be so small it fits cleanly into your message – not as an attachment (many folks are reluctant to open attachments). It should do only one thing, and that is illustrate the problem, and it should be self-revealing.

What A Great Question Might Look Like:

Topic: When I add data to my listBox I sometimes get an “Index was outside the bounds of the array”

Message: I have a program that adds strings to a listBox based on the user pressing a button. Here is a stripped down example. In the Xaml I declare a button and a list box:

using System.Windows;
using System.Windows.Controls;

namespace Error
{
   public partial class MainPage : UserControl
   {
      string[] data = new string[] { "a", "b", "c", "d" };

      public MainPage()
      {
         InitializeComponent();
         AddFieldToListBox.Click +=
         new RoutedEventHandler( AddFieldToListBox_Click );
      }

      void AddFieldToListBox_Click(
           object sender, RoutedEventArgs e )
      {
         for ( int i = 0; i <= data.Length; i++ )
         {
             ListOfText.Items.Add( data[ i ] );
         }
      }
   }
}

The error happens on line 22 (adding the data). I don’t see how it is out of bounds.

This is a fairly plausible error for a newbie to run into and it is an inviting question to answer: the topic tells me what I’m dealing with, the message is very short but tells me what I need to know and the example, while short, makes obvious where the problem is.

Key here is short – the shorter your message and the smaller your example, the more likely you are to get an answer; don’t make the people who want to help you work harder than necessary.