# How to ask a good question

**URL:** <https://forum.codewithmosh.com/t/how-to-ask-a-good-question/19076>\
**Category:** JavaScript\
**Created:** [March 23, 2023, 6:02am UTC](https://forum.codewithmosh.com/t/how-to-ask-a-good-question/19076 "2023-03-23T06:02:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mechanicDev](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mechanicDev](https://forum.codewithmosh.com/u/mechanicDev)\
**Post date:** [March 23, 2023, 6:02am UTC](https://forum.codewithmosh.com/t/how-to-ask-a-good-question/19076/1 "2023-03-23T06:02:57Z")

</div>

If a moderator or admin can pin this message, it may help some of the newer coders get faster answers to their questions by helping them to understand how to ask a good question.

It is important to remember that when you post to a forum such as this, the people on the other end that are reading the questions… well, we’re people and not a Google search box. What I mean by that, is generally the 1st attempt at asking a question by a new dev is to say… “I can’t do this, how do I do this”. And while that may seem like a perfectly valid question to you, it is almost zero help to any of us trying to answer questions. Because the answer is always “Well… It depends…”

There is no ONE right way to do anything, it all depends on the context of the question. Which is what the previous question is missing… context. When you ask a question it is important to be able to answer 3 things before you start to type.

1. What is the error?
2. What did you expect?
3. What have you tried?

For instance, the question at the top of the JS forum says “How do I do a loop”. Well… what kind of loop? What are you looping over? An object? An array?.. What error are you getting (That was kind of answered by the statement it was crashing the browser, you have an infinite loop… and lastly… What have you tried to resolve it?

Some times just the exercise of asking a better question will provide you the answer before you even ask the question. But, worst case scenario, you will receive a faster answer because the person that reads it will have a better context to your error.

Please do not let this discourage you from asking a question, if you truly do not know how to answer any of those, just ask whatever question you can and people will help, but if you practice asking better questions you will find it makes you a more pragmatic coder and also it will get you better answers.

Happy Coding!!

---

<div class="post-metadata">

**Author:** ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)\
**Post date:** [March 23, 2023, 5:38pm UTC](https://forum.codewithmosh.com/t/how-to-ask-a-good-question/19076/2 "2023-03-23T17:38:29Z")

</div>

Hi,

I second that. I saw a question about loops that may be the one you took in example.

The thing is indeed we cannot guess much what’s going on without code samples most of the time. Even if the problem is simple we need to see. Especially if like me you are a visual person.

Also when providing code ideally do it by text. Screenshot may be OK but text allows anyone to copy and try on their own machine or other mean. Fiddle sites are even better for small snippets.

I actually have the opposite quirk of often being too specific. People just don’t read that. So I sometimes add TLDR summary.

My philosophy is help others help you and hence I do my best to provide all I can. But sometimes we have really no clue on a subject. This is when we shall communicate. Remain available to any question potential helping people could ask.

Indeed everybody is encouraged to ask questions. We all do mistakes and we all learn. **Just try your best to help others help you**.

Cheers.

---

<div class="post-metadata">

**Author:** ![SAM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sam/32/167_2.png) [@SAM](https://forum.codewithmosh.com/u/SAM)\
**Post date:** [March 23, 2023, 7:23pm UTC](https://forum.codewithmosh.com/t/how-to-ask-a-good-question/19076/3 "2023-03-23T19:23:47Z")

</div>

Well - two years ago… 😉

> [@The art of asking coding questions](https://forum.codewithmosh.com/t/the-art-of-asking-coding-questions/3137):
>
> Old, but still very relevant: [The Art of Asking Coding Questions](https://programmingwithmosh.com/general/art-asking-coding-questions). When creating a new topic here choose the appropriate category and supply a meaningful title. If you’re referring to a lesson name the course, the section and lesson If you have a problem with your source code supply that source code. If you’re pasting it here make sure to [format it properly](https://forum.codewithmosh.com/t/code-formatting-and-syntax-highlighting/186/3). Post code, not screenshots of code if you want an answer. Noone will typewrite your code from a screeshot but chances are high that someon…
