Learning how to ask for help is important. Every developer needs help at some point, especially when they’re learning new things. By structuring your question effectively you can make it easier for people to help you, and increase the likelihood of solving your problem.
Here are the steps to follow when asking for help. More detail is provided below!
- Try to debug on your own
- Google the problem
- Describe the problem and what you’ve tried
- Make sure to include a code sample
- Update with the solution
Make sure you’ve tried to solve the problem on your own first. Often it can be as simple as a typo, or forgetting to save your changes—it’s best to ensure you really have a problem before involving someone else. Make sure you have at least googled your problem!
The amount of time you spend trying to solve the problem should be proportional to how much time you have. If you’re doing a 1 hour workshop then spending 15 minutes stuck is a bad use of your time. You should probably ask for help after 5 minutes. However if you’re on a 2 day project you should spend more like 20 minutes searching for your own solution.
It’s important to develop your problem-solving and debugging skills. If more experienced people always tell you what’s wrong then you’ll struggle later in your career. Read the debugging guide for more information on solving code problems.
Once you’re sure you have a problem you cannot quickly solve on your own you should post a message asking for help in the appropriate channel. This could be your cohort’s
#help-and-solutions Discord channel, or the more general
#facoverflow, or even somewhere public like Stack Overflow or a project’s GitHub Discussions.
A good message should describe the problem, and especially what you want to happen. Often people describe a specific syntax issue, when really their problem is with their whole approach. For example for “how can I swap two numbers in this date string?” the most helpful solution might be “use the built-in date internationalisation method instead”.
You should also include anything you have already tried. That way someone helping you can skip over solutions that you already know won’t work.
Make sure you include a code sample. That way somebody can try to help you straight away, without having to ask you questions and wait for responses.
You can copy/paste the relevant code if it isn’t too complicated, but try not to dump an entire 100+ line file onto someone who has never seen it before. If your code is very complex try to provide a simplified example of what you’re trying to do.
Make sure your code is syntax-highlighted (if the platform supports it)! For example on Discord and GitHub you can use three backtick characters to create a code block. Put the name of the language you’re using on the same line directly after the backticks to get syntax-highlighting. E.g. this:
```html <h1>Hello world</h1> ```
will produce something like this:
If your project is on GitHub then consider linking directly to the lines of code in question. You can do this by clicking the line number on GitHub. Make sure you have pushed your latest work to a branch so it’s up-to-date.
This one is important. Don’t ask for help and then disappear. Make sure you keep an eye on any followup questions that may get asked. It’s hard for a mentor to help if they can’t get additional information out of you.
It’s also very frustrating as a mentor to suggest a potential solution and then never hear back. It’s okay to be busy on a project, but try and provide a quick update like “thanks, it worked!” or “thanks, the problem was actually xyz instead”.
This is not only good manners but also helpful for anyone else reading who may have a similar problem—having a solution confirmed or not could save them lots of time.