Stack overflow is notorious for gatekeeping and being hostile. I’ve personally found that discord communities answer my questions much better. Cross-posting questions across discord servers and waiting patiently have gotten me very far. You may want to try another place and make sure you’re aware of the social etiquette of programming communities.
Asking good questions is a vital skill in programming. Here’s some suggestions to improve your etiquette. The individual points aren’t deal breakers but if you follow none, you’ll get ignored or banned in most programming communities.
You may not be following the social etiquette without realizing and that’s okay, now you know what skill to improve on.
- Show you’re making an effort to fix your problem on your own. Easy ways to do this is recount all the debugging steps you’ve tried and how they failed or if you aren’t sure where to start debugging make that clear and ask for information about debugging in your language.
- “Don’t ask to ask” – Resist the temptation to preface your questions or ease into the topic. It’s seen as wasting peoples time in programming communities. If you’re from an academic background this may be a culture shock to you.
- Give as much detail as possible, this means post error messages exactly as you receive them (you can however, censor personal details). If it’s long and long messages are discouraged in your community, post it on a site like bitbucket. This also means give details about your setup, like the language name and version, operating system, etc. Even information that turns out to be irrelevant is good because it shows you’re trying, being upfront and detailed and is a starting point for others to work from. Even giving the wrong information can immediately highlight to others what’s gone wrong.
- Carefully read and follow the rules and style guidelines of the community if they exist. I’m aware that stack overflow is extremely strict about question formatting and you will be fought for breaking them. Other sites are less strict but most will hesitate to help you if you ignore them.
- Be aware, that the person who answers you will not know everything about the topic and they will not solve the problem for you. They can be from any background, they may get it wrong; they may have no idea. They are there to learn with you. If you want someone to write or fix your code for you, you are looking for a paid employee, post a well paid job listing or accept the fact you will often struggle and won’t know everything and your peers will too.
- Use the conventional means to ask questions. For example, discord communities often have a
forum
section where you write in detail about your problem. Other communities may expect you to email them and follow a template, for example. If it’s unspecified, it’s best to ask. - Use code blocks to clearly show when you have pasted something in. On discord, this means put “` on the line before and after, this formats your message clearly.
Unfortunately, it’s a bit different on every site, so you’ll have to search your site’s for documentation that mentions it or ask - Avoid asking for solutions, ask for resources, perspective and skills instead. They will save everyone time because you can learn about something at your own pace, in your own way and the other person doesn’t need to explain everything from scratch to you in the moment. Explaining programming topics from scratch is very difficult, not everyone is good at it, learning styles differ and it’s time consuming. You’re best off seeking premade resources that match your learning style and experimenting.
I’m not saying you aren’t doing any of these, what I’m saying is there are common pitfalls you should be aware of that you and others may accidentally fall into. It may be especially strange and take time to adjust to for people that come from academic backgrounds where formality and tradition are highly valued and baked deeply into everything. Play nice – miscommunications happen all the time, it doesn’t help to place blame on yourself or others when you’re both acting in good faith. Being able to identify what went wrong and how we can work together to prevent it moving forward is what’s most important.
Examples:
Please note, these examples don’t include all points given above.
Don’t say | Hi guys I need help with my java program |
Because | It gives no information and violates the “Don’t ask to ask” guideline |
Try instead | Hi, I am trying to write hello world in java by following this tutorial https://www.programiz.com/java-programming/hello-world . I am using Java 8. I keep getting this error. I have no idea what it means “` Exception in thread “main” java.lang.StackOverflowError at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7)at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7)at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7)at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7)at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7)at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7)at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7)at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) at HelloWorld.main(HelloWorld.java:7) “` I have no idea what I’m doing wrong, I tried changing class Main to class main because I thought maybe I spelt that wrong but it caused a different error. Am I missing something obvious? Here is my code so far: “`java class Main { public static void main(String[] args) { main(args); } } “` |
Don’t say | This doesn’t work print(“Hello world”) |
Because | – It’s not clear which language you’re using. – It’s not clear what error you experienced. |
Try instead | Hi, this python code doesn’t seem to work “` print(“Hello world”) “` Here’s the error “` Exited with status 101 Standard Error Compiling playground v0.0.1 (/playground) error: expected one of ! or :: , found ( –> src/lib.rs:1:6 | 1 | print(“Hello world”) | ^ expected one of ! or :: error: could not compile playground (lib) due to previous errorStandard Output Warnings No main function was detected, so your code was compiled but not run. If you’d like to execute your code, please add a main function. “` There’s so many errors, does anyone know why? I tried with single quotes (`) but it causes a different error I don’t understand. |
Don’t say | Hello can anyone help me with this please [image of homework] |
Because | – We don’t know what you need help with. Maybe you need help reading through the task, maybe you’re got a program 99% written and you’re stuck on one strange error. Please be specific – It sounds like you haven’t tried anything which implies you don’t value our time – We are not your servants or your tutors as such we will not be doing your homework for you or teaching you every required skill for it |
Try instead | I am stuck with this project I’ve been given. It looks so daunting, where should I start? I don’t know anything about my course, the teacher is useless! Are there any resources you suggest? [image of homework] |
Don’t say | Does anyone know Smalltalk? |
Because | – Violates the “Don’t ask to ask” guideline. Nobody can help you because you’ve not stated a problem – We don’t know if you need help with something. It looks like you’re just making small talk in the wrong place. |
Try instead | I can’t find the Smalltalk documentation, searching for Smalltalk gives me so many irrelevant results. Can someone please link the official site for me? |
Don’t say | Hi, is someone available who could offer me some guidance with my code. I don’t know where I’m going wrong. |
Because | – We don’t know where you’re going wrong either because you’ve not told us what the problem is. We want to help but have nothing to go on – Violated “Don’t ask to ask guideline” |
Try instead | Hi, I would like guidance with the following code. I am overwhelmed with the error messages I’ve received. What does it all mean? Code: “` #include \ int main() { string message = “hello, mate”; std::cout << message; free(message); return; } “` Error: “` ERROR! g++ /tmp/b9tCUkhrVn.cpp /tmp/b9tCUkhrVn.cpp: In function ‘int main()’: /tmp/b9tCUkhrVn.cpp:6:5: error: ‘string’ was not declared in this scope 6 | string message = “hello, mate”; | ^~~~~~ /tmp/b9tCUkhrVn.cpp:6:5: note: suggested alternatives: In file included from /usr/local/include/c++/12.2.0/iosfwd:39, from /usr/local/include/c++/12.2.0/ios:38, from /usr/local/include/c++/12.2.0/ostream:38, from /usr/local/include/c++/12.2.0/iostream:39, from /tmp/b9tCUkhrVn.cpp:2: /usr/local/include/c++/12.2.0/bits/stringfwd.h:77:33: note: ‘std::string’ 77 | typedef basic_string\ string; | ^~~~~~ In file included from /usr/local/include/c++/12.2.0/bits/locale_classes.h:40, from /usr/local/include/c++/12.2.0/bits/ios_base.h:41, from /usr/local/include/c++/12.2.0/ios:42: /usr/local/include/c++/12.2.0/string:65:11: note: ‘std::pmr::string’ 65 | using string = basic_string; | ^~~~~~ /tmp/b9tCUkhrVn.cpp:7:18: error: ‘message’ was not declared in this scope 7 | std::cout << message; | ^~~~~~~ /tmp/b9tCUkhrVn.cpp:11:5: error: return-statement with no value, in function returning ‘int’ [-fpermissive] 11 | return; | ^~~~~~ “` |