Don’t ask people to write your code for you
You will quickly find your question downvoted and closed if you simply ask
“How do I do X?” The SO community expects you to make an effort to solve
your own problem before resorting to SO. Describe in your question what you’ve
tried and why it isn’t working.
Ask one question at a time
Questions that are asking several things—“How do I do this, then that, then the
other things, and what’s the best way to do this?”—are difficult to answer, and are
discouraged.
Craft a minimal example of your issue
I answer a lot of SO questions, and the ones I almost automatically skip over are
those where I see three pages of code (or more!). Just taking your 5,000-line file
and pasting into an SO question is not a great way to get your question answered
(but people do it all the time). It’s a lazy approach that isn’t often rewarded. Not
only are you less likely to get a useful answer, but the very process of eliminating
things that aren’t causing the problem can lead you to solving the problem your‐
self (then you don’t even need to ask a question on SO). Crafting a minimal
example is good for your debugging skills and for your critical thinking ability,
and makes you a good SO citizen.
Learn Markdown
Stack Overflow uses Markdown for formatting questions and answers. A well-
formatted question has a better chance of being answered, so you should invest
the time to learn this useful and increasingly ubiquitous
Accept and upvote answers
If someone answers your question satisfactorily, you should upvote and accept it;
it boosts the reputation of the answerer, and reputation is what drives SO. If mul‐
tiple people provide acceptable answers, you should choose the one you think is
best and accept that, and upvote anyone else you feel offered a useful answer.
If you figure out your own problem before someone else does, answer your own question
SO is a community resource; if you have a problem, chances are, someone else
has it too. If you’ve figured it out, go ahead and answer your own question for the
benefit of others.
If you enjoy helping the community, consider answering questions yourself: it’s fun
and rewarding, and it can lead to benefits that are more tangible than an arbitrary
reputation score. If you have a question for which you’ve received no useful answers
for two days, you can start a bounty on the question, using your own reputation. The
reputation is withdrawn from your account immediately, and it is nonrefundable. If
someone answers the question to your satisfaction, and you accept their answer, they
will receive the bounty. The catch is, of course, you have to have reputation to start a
314 | Chapter 22: Additional Resources