Asking questions as a developer

There is an art to asking questions that are easy to answer. I’ve been part of developer communities for the last 10 years and have seen all sorts of things ranging from copy homework questions and pasting them in chat rooms to experienced devs writing out and answering what seems like a straight forward question with fantastically well written responses in great detail.

There’s no problem in asking questions, everyone has them and you should ask questions and learn as much as you can but there’s a limit. You don’t want to be coming off as lazy or someone who isn’t able to help themselves. Especially online in public chatrooms when people have lives themselves, they’re offering their help for free on their own time.

So here’s a few tips that I’ve exercised and compiled through-out the years.

Google. Google. Google.

A large chunk of being a developer is learning how to break down issues into easily searchable strings. Ask yourself, does this even need to be asked in the first place? If it’s quicker to type into a search box to get the answer, do that before asking anyone else.

What’s the difference between var and const?

Here ya go, Var, Let, and Const – What's the Difference?

Things like this can easily be answer via a google search. It's more valuable to the person asking the question to learn the skill of research than it is to be given the answer. It sounds mean, but it's the truth; there's value in learning how to use search engines to answer your own questions, quickly.

The don’ts of asking a question in a developer community.

Hello, can anyone help me? Does anyone know react?

Anyone around to help resolve a JS console error in DM?

These questions are open-ended and it’s highly unlikely that anyone will want to take on the responsibility of answering it. Chances are asking questions like these will go unanswered or ignored because of the low effort. Definitely do not ask to break off into a DM, the conversation gets too heavy and personal. It’s your question and problem, not the responsibility of a stranger online.

In short, don’t ask to ask.

The do’s asking a question in a developer community.

Show some effort that you put in and where you think you’re having some trouble. Are you hitting a road block with a specific set up? Give details into that. Be direct with your first ask, leave little room for follow up questions.

Hi. Is there any way to push an object directly to the state instead of destructuring that array into a new one, pushing the object then setting the sate? This is what I have, is there a shorter way to do it?

const [arr, setArr] = useState(null)
const obj = { id: 123 }

setArr(arrWithSomeStuff)

let newArr = [...arr]
newArr.push(obj)
setArr(newArr)

This question is a great as it outlines what you have and what you’re trying to do. They’ve supplied their code, so anyone in the community can reply with input that requires no clarification.

setArr((prev) => [...prev, obj])

Easy!

TL;DR

Ask your question directly and don't ask for permission to ask a question. Try not to ask open-ended questions or questions that need to be answered with other questions. Provide as much relevant info as you can as well as sample code. Do not post screenshots or photos of your code on screen. Providing context around your code sample helps give everyone some clarity on what problem you are facing.