Getting good answers on StackOverflow – part 13 of n

Tip #13 – What have you tried?

when describing your problem, make sure to include details of what you already tried. This will help ensure that you do not get answers that go into more depth and that will suggest things you have not tried.

Tip #1 – Ask a question

Tip #2 – Be polite

Tip #3 – Ask one question

Tip #4 – Descriptive title

Tip #5 – Write in English

Tip #6 – Pertinent code samples

Tip #7 – Stay on topic

Tip #8 – Do some research

Tip #9 – Stay engaged

Tip #10 – What, not how

Tip #11 – Accept rate

Tip #12 – Code that shows the problem

Getting good answers on StackOverflow – part 12 of n

Tip #12 – Code that shows the problem

When posting a code sample, make sure that it is representative of the problem you are having. This means that it needs to be syntacticly correct (otherwise, people will point out the syntax errors and not the problem you are trying to solve), if possible it should compile and it must clearly show the problem.

This will ensure that people will be able to easily reproduce the issue and answers will be relevant to the problem.

Tip #1 – Ask a question

Tip #2 – Be polite

Tip #3 – Ask one question

Tip #4 – Descriptive title

Tip #5 – Write in English

Tip #6 – Pertinent code samples

Tip #7 – Stay on topic

Tip #8 – Do some research

Tip #9 – Stay engaged

Tip #10 – What, not how

Tip #11 – Accept rate

Getting good answers on StackOverflow – part 11 of n

Tip #11 – Accept rate

Your accept rate tells people if you go back to your questions and choose the best answer for each question. A low rate is seen as a very negative thing and many people will not answer a question from someone with a low accept rate. Make sure your accept rate is high.

Accept rates are no longer displayed on questions or the user profile.

Tip #1 – Ask a question

Tip #2 – Be polite

Tip #3 – Ask one question

Tip #4 – Descriptive title

Tip #5 – Write in English

Tip #6 – Pertinent code samples

Tip #7 – Stay on topic

Tip #8 – Do some research

Tip #9 – Stay engaged

Tip #10 – What, not how

Getting good answers on StackOverflow – part 10 of n

Tip #10 – What, not how

When posting a question, don’t say how (or how not) you want people to answer it (for example, “I don’t want to hear about xxx”, “Only solutions in yyy”), but explain what you are attempting to achieve. This gives context to your question and better answers will result.

By telling people how you want to do things, you are limiting the answers and possibly offending them.

Tip #1 – Ask a question

Tip #2 – Be polite

Tip #3 – Ask one question

Tip #4 – Descriptive title

Tip #5 – Write in English

Tip #6 – Pertinent code samples

Tip #7 – Stay on topic

Tip #8 – Do some research

Tip #9 – Stay engaged

So you need to format some money

When formatting a currency for display, always use a CultureInfo object when outputting in order to get the correct formatting – different places will have a different thousands separator, decimal separator and more.

In many cases, you can get the CultureInfo from the UI thread and in a web application you could guess which one is the correct one, by parsing out the user agent header.

If you always want the exact same output, you do not have to specify a format string, simply use CultureInfo.InvariantCulture, this is a dummy culture and does not correspond to any country/region. The different settings are similar to “en-US”.

This example will output the format for the Swedish culture.

decimal value = -16325.62m;
Console.WriteLine(value.ToString(CultureInfo.CreateSpecificCulture("sv-SE")));

This example will output the format for the InvariantCulture.

decimal value = -16325.62m;
Console.WriteLine(value.ToString(CultureInfo.InvariantCulture));

Here is a list of culture names.

Getting good answers on StackOverflow – part 9 of n

Tip #9 – Stay engaged

Don’t fire and forget – that is, keep going back to your question, read the comments and answer and respond to them. If you engage with the people that respond to your question, chances are good that you will get the answer you are looking for.

Tip #1 – Ask a question

Tip #2 – Be polite

Tip #3 – Ask one question

Tip #4 – Descriptive title

Tip #5 – Write in English

Tip #6 – Pertinent code samples

Tip #7 – Stay on topic

Tip #8 – Do some research

Getting good answers on StackOverflow – part 6 of n

Tip #6 – Pertinent code samples

Post code samples that show the issue, this will help others understand the issues better than paragraphs full of description.

Do not post pages and pages of code – no one will want to read through that, so limit yourself to code that is directly relevant to the question.

Tip #1 – Ask a question

Tip #2 – Be polite

Tip #3 – Ask one question

Tip #4 – Descriptive title

Tip #5 – Write in English

Getting good answers on StackOverflow – part 5 of n

Tip #5 – Write in English

The language of StackOverflow is English.

Do not post in another language, as your question will get closed promptly.

Check your spelling and grammar, and do not use text speak (type “you” instead of “u”, “please” instead of “plz”). This show that you care to be understood, so others will be more likely to respond.

Tip #1 – Ask a question

Tip #2 – Be polite

Tip #3 – Ask one question

Tip #4 – Descriptive title