Duck's Blog

How to ask a question?

Author: Duck

28.03.2021

How to ask a question?

We all encounter issues in our code. There is always something that doesn’t work as intended. Many people are in need of help and ask in forums or other places where developers come together. Communicating with other developers and exchanging your knowledge is a great way to learn something and solve your problems.

However, it is very important to consider how you ask your questions, so that other people can help you much more efficiently.

How to start

Self-made solution

First try to solve the problem yourself before immediately asking for help. Sometimes you may be able to come up with a solution without any help. That could also increase the learning effect and you gain self-confidence, especially as a beginner, because you managed to solve a problem yourself. That doesn’t mean you should spend hours racking your brain, but you should at least think about the problem.

Google is your friend

The next step would be to google your problem/question (you may use whichever search engine you want of course). Most questions are probably already answered on the internet, because you’re definitely not the first one with this particular problem/question. You can even combine different articles, posts and the official documentation if there is one to solve your problem or answer your question. That’s how you mostly have to act in order to find your answers. You can’t always get everything served on a silver plate. Knowing how to successfully google something is a crucial ability for every developer.

For more information and an extended explanation, I recommend my blog post on the question "How to Google?" .

Using the documentation

To come back to the mentioned documentation: The documentation of an API, programming language or program is a valuable source for gaining certain information and important tips. Documentations are manuals in which the functionality is always explained verbally and supported with examples and references. Since this is a direct interface between the developers of the product and us users, you usually get 100% reliable first-hand information.

Asking correctly

If you are really stuck after trying to solve it yourself and googling it, your final option is most likely to ask someone. To save your and the valuable time of the people who are willing to help you, you have to ask your question correctly. So, what does that mean? It means that you provide as much information as needed, so someone can actually help you.

Don’t ask to ask

There are a few simple “common-sense” rules you need to follow: Don’t ask to ask. You don’t need to ask, “Can someone help me?” or anything similar and wait until someone approves it, so that you can finally ask your question. Ask your question right away. When you’re asking, people already know you have a question. You can skip the needless introduction. We’d much rather you just ask your question outright.

Simply stating: “It doesn’t work” or anything similar that doesn’t provide any information is by far the worst thing you can do wrong when asking a question.

What a question really needs to contain

In case of a problem with your code or any other issue, where a certain thing doesn’t behave as intended, the information you’re providing is especially important.

  • What is not working?

  • What is it supposed to do?

  • What is it doing instead?

  • What have you tried so far?

  • Provide the relevant code (we'll come to that in a minute) .

  • Share any related errors you are getting, especially if the issue revolves around this error. Please don’t only share the error code, but the entire error.

  • Provide useful screenshots, recordings or related links if necessary.

Of course, you don’t have to throw a wall of text at the users who are trying to help you, but it is extremely important that you provide all the important information, so that someone can actually help you. A slightly more detailed question also gives the impression that you really put effort into this problem and probably already tried to google it, whereas something like “Hi, I have an error” doesn’t have such an effect. It’s more of an, “I’m lazy and I want you to solve my problem so I can move on” and that’s generally just a wrong attitude, which actually decreases the chance to find people who are motivated to help you.

Format your code

If your issue is related to your code, please consider providing your code and formatting it correctly. It is much easier to help you if you provide a nicely formatted code, so that people don’t have to suffer their way through raw unformatted text or an image of the code.

Image of your code? Hell no!

Please do not send pictures of your code. That’s another thing you can do horribly wrong when asking a question. There are a few problems with that, especially if you take a picture with your phone (oh dear!). Don’t ever do that! It’s really hard to read anything there at all and if someone wants to reproduce your issue or test your code, they’d have to type it out, instead of just copying it from a nicely formatted codeblock. Very inefficient, indeed.
I saw a lot of things. From dusty monitors, to pictures taken from what felt like a few meters away from the monitor, up to entire floodlights behind the person taking this picture. Slightly caricatured, this unfortunately is the truth. You literally can’t read a single letter there and it’s very inconvenient. Just… don’t!

Image of your code? NO!

Codeblocks are much better

Whichever platform you use to ask a question, there is often an option to make a codeblock (even if not, there is always a solution ). Let’s take Discord for example. Discord has a nice codeblock system with which you can even specify the Syntax-Highlighting language. But how do you make a codeblock in Discord? That’s quite simple. Here is an example of how you’d do it with C# Syntax-Highlighting. However, Discord supports many different languages and highlighting styles. Every common programming language and even less common ones should be supported in Discord. You can find an extended list of all the supported languages here . The typical file extension of the language you’re using usually works out.

Discord codeblock

```cs
// Paste your code in here
```

You use the same way to make a codeblock in Stack Overflow for example as well. It is important to use the backquote/backtick character ` instead of the apostrophe ‘. On US- and UK-keyboards, you can find this character right next to the 1 (above the Tab key) and you need to hold the Shift key in order to use this character. Since this is a so-called dead key , you need to press it twice to show up. That will display two of them. They are still two single characters, which you can delete individually. Also a common place where you can find it is right next to the backspace key, as in my case. That typically applies to the Swiss- and German keyboard layout for example.

But what if your code is too long or you’re using a platform without the ability to create a codeblock? I got you covered!

pastemyst is great

If your code is too long and exceeds the character limit of a message (2000 characters in Discord for example), you have to find a different solution than a codeblock. That’s why paste tools exist. "pastemyst" is one of them and in my opinion the best paste tool online. You can simply share as much code as you want with a few clicks on a completely free website with several themes, Syntax-Highlighting for every common language and many more features. It is also available in all countries, completely ad-free and open-source .

Quick guide on how to use pastemyst:

  • Open https://paste.myst.rs/

  • Paste your code in the big text box (you can even divide the code in different scripts and add titles to each of them as well as an overall title for the entire paste).

  • Choose the Syntax-Highlighting language or let pastemyst detect it automatically.

  • Click “create paste”!

  • Share the generated link (copy the link in the search bar)!

This is pastemyst This is pastemyst

Be patient and stay polite

Just a few notes to finish off this blog post. Please try to stay polite and grateful with the people who are trying to help you. They are not obligated or getting paid to help you, they are doing this voluntarily. Nobody can force them to help. Once you ask your question, wait patiently for an answer. Don’t spam your question multiple times in a short period or come up with things like “Guys?” or “Anyone?” to express your impatience. Someone will answer if they can, have time and want to. None of these impatient and/or rude acts will help you to solve your problem faster.

Now you should be fully prepared to solve all kinds of issues. Happy developing!