How (not) to ask technical questions

How (not) to ask technical questions

Яico X

When doing tech stuff, you'll sooner or later come to some point, where your current knowledge is not sufficient to solve an issue or you need to ask somebody else, who has more experience to save you from a lot of searching.

This is nothing to be ashamed about. Knowledge doesn't just appear. It needs to be build up from knowledge of other people. Only when you read what other people found or ask what other people know, you'll build up your own knowledge.

This article is about how to ask questions, if you are stuck. I am focusing on asking questions related to Telegram bot development, but it applies to all technical questions. It's also based on the YouTube video of LiveOverflow about the very same topic. There is a very good quote from him in that video.

You want something from me or from somebody else, so please put some effort in it.

Because if you don't, you won't get the answer and help you expected to get.

Provide enough information right away

When you come accross an issue, make sure to collect as much information as possible and provide it to the person you are asking the question. If you created a program and run into issues, provide at least the following information:

1. What programming language are you using
2. What framework/library are you using (+ system information)
3. What is the exact error message
4. What is the expected behaviour and what is the actual behaviour
5. What have you already tried (also failures)
6. Part of your code which doesn't work

When you provide less information it's really hard to understand what the exact issue is. Something like "my code doesn't work" or "How to send message" doesn't help anyone, including yourself. The person you are asking will need to ask you several questions back.


Try to localize or narrow down the error to a certain domain

Errors can happen almost everywhere, where humans interact with a computer. So make sure you have checked multiple ways (e.g. trying to provide different test data) before asking your question. Compare these two questions:

When I try to send a message, the user doesn't receive it.

versus

When I try to send a message, which contains certain emojis, with the python-telegram-bot framework the message is not sent and there is no error given by the API

With the latter one you can clearly identify the problem domain. It's about emojis and sending messages. An experienced user can then tell you, if this is a known bug in the API or just some strange bug with your code or framework. The first one doesn't give any information about where the issue exactly is located, which leads to the problem that other users need to check the issue multiple times and ask you several questions before you get your awaited answer.

(Selection of) Possible problem domains and their reasons

Be precise

Try to explain everything as accurate as possible in as little messages as possible. Again you won't profit from writing tens of messages with extra information you found out while debugging. Try to provide all information right away and put it into a single, well formatted message.


Examples for bad questions

The bot does not work and the messages do not connect to me.

No information about the used language, framework or system given. Also no information about the issue domain (network, code, API).

I have problem: my bot work when using private, and not work when i add into group... how to solved it?

This question at least contains a vague indicator about where the issue might come from, which helps experienced users to understand what might be the reason. First Telegram bots must be "enabled" so they can be added to a group, second the bot can only receive messages which are posted as a reply or with it's username in it. So debugging this can be quick if it's one of those, but takes a long time, when it's something different (e.g. with the code).

Examples for good questions

I'm getting 'HTTP 400 USER_INVALID_ID' when calling getChatMember for some valid users that the bot HAS seen in the past. Do any of you know why the api would "forget" about an user?

The user provides the error code they receive, the method they call and also add, that they tested it with user_ids, which the bot has seen/contacted before. This narrows down the problem area to only a small amount of possible points.

I am using the python programming language together with the python-telegram-bot framework, hosted on a powerful VPS of a big hosting provider with good internet connection. When I send several messages (e.g. 3) quickly after each other into a chat, the bot sends the first message instantly and the other ones with some delay. Does anyone know why this is happening?

This user provides information about 1) programming language 2) framework and 3) hosting. As a reader you can identify that it's rather unlikely to be a network issue then. Also the framework is known to be well maintained and python is a stable language. The issue can immediately narrowed down to spam limitations (because it's not allowed to send more than one message to a chat per second). One question, one answer, no waiting - everyone's happy.


I hope I have been able to provide you some information on how to ask (technical) questions. If everybody would follow these rules, issues could be resolved way faster.

Report Page