Learning how to code is difficult, and the learning never stops. That is why it is very common to become stuck while writing a piece of code. Luckily for everyone, Stack Overflow is a great online forum that is full of smart people who are happy to take time out of their day to help you with your issues. However their help is not guaranteed, and even if it was, it might not be effective unless you make sure you asked your question smartly.
The core principle being asking smart questions is simple. If you can make your question easy to read and understand, people are more likely to help, and the help that they give is more likely to be helpful. To do this, there are three simple steps. The first step is to make sure that your question is actually smart, and this is done by searching up your issue/question online. There are millions of programmers worldwide, and chances are there was at least someone who ran into the same issue as you, and hopefully they were able to find some help that you’ll be able to look at. The second step is to state your issue clearly and concisely. When developers on Stack Overflow with the intention to help others, they don’t want to spend 30 minutes figuring out what you’re even asking. That’s why you have to be clear about what went wrong, and what you want to happen. The third and final step is to list all the things you’ve already tried. No one wants to help someone who is just looking for an easy answer, and no one wants to reinvent the wheel by suggesting fixes that you already attempted. Listing everything that you’ve already tried will get rid of redundant answers and lead to you receiving much better answers.
To demonstrate this concept, I have two examples. One is a smart question that has led to a very good answer, and the other is not so smart with an answer that probably helped no one. For the smart question I have this post, which had the poster struggling with rotating a rectangle to the correct position. He asked his question about as good as you can ask one. He presented his problem clearly and concisely, and provided pictures so that you can see exactly what went wrong. He also provided a short snippet of code, which was formatted nicely and easy to understand. In that post, he got a phenomenal answer that explained what he did wrong, and provided an indepth solution with some code that they wrote themselves. On the other end, we have this question, also about rotating rectangles, but asked in a much worse way. The first thing that you’ll notice is a large blob of text that is more about the class that they’re taking than the problem that they’re facing. Even if you were to decipher what they’re asking, you’ll notice that they copied and pasted their code in plain text. This made the already hard to read question impossible to read. They were lucky enough that someone still tried to help them, but the answer they provided was just a guess on what the poster was struggling with. They even mention in the answer that they want a better explanation of the problem with better formatting on the code so that they can understand the question better.