Common Questions on Stack Overflow Part One: How To Get Help

Jamie Taylor2 comments
Common Questions on Stack Overflow Header ImageSource: Copyright 2018: quimono

Today’s header image was created by quimono at Pixabay

The keen eyed amongst you will have noticed that I haven’t written very much on this blog since December.

There are a bunch of reasons as to why this has happened, but I wont go into them. Suffice to say that, going forward, I’m going to be posting on a more regular basis again. I’ll also be streaming on a regular basis, too.

I’m also working to get a podcast off of the ground. Before you get excited, it’s not a .NET Core one 

What Does All Of This Have To Do With Stack Overflow?

For those who don’t know, Stack Overflow is a question & answers site where developers and IT experts can ask and answer questions. It’s a little similar to what Tech Community from Microsoft is aiming for – except that with Tech Community you can discuss any issues that you’re facing with the engineers who are working on the product that you’re using.

Here’s what their about page says:

Stack Overflow is a question and answer site for professional and enthusiast programmers. It’s built and run by you as part of the Stack Exchange network of Q&A sites

Which is pretty much what I just said.

The idea is that a developer (or IT expert) can ask a question about something that they’re having trouble with, and experts in the community will provide assistance and answers to the question. The rest of the community are then asked to vote on the answers and comments which provided the most information, and the person who asked the question is required to mark the answer which helped them the most.

At it’s heart, it’s knowledge and experience sharing in the most democratic way.

One of my goals for this year is increase the amount of help that I offer to the development community, and one of the best ways to do this is to help folks who are struggling or asking for help.

of course, another way to give back would be to contribute to .NET Core’s source code

To reach that goal, I’ve started looking at questions on Stack Overflow which are tagged with either .net-core or and providing comments and answers for those questions.

Things I’ve Noticed

Based on the questions that I’ve read through (and the comments and answers that I’ve posted recently), I’ve noticed that there are a lot of repeated questions. Most of them fall into the following extremely broad categories:

  • “I didn’t search to see whether anyone else has had the same issue, so I’ll just post mine and hope for the best”
  • “How do I use a .NET Core library with .NET Framework?” (and vice versa)
  • “Why can’t I use this Windows specific API call on Linux via .NET Core?”
  • “I want to target some old NuGet package on both a .NET Core and a .NET Framework project. My Framework project is running either 3.5 or 4.1, why can’t I use the same NuGet package?”
  • “I haven’t read any of the documentation or done any searching, but why can’t I do x in .NET Core?”

A few of the repeated questions have minutia which make them specific to that person’s situation, but a lot of the repeated questions fall into one (or more) of those categories.

Because a lot of these repeated questions end up having the same answers

in fact, I’ve directly linked to answers in some of my comments on questions. Like this one

I’ve decided that I would type up generic versions of my answers to those questions, in the hope that I can either link directly to them or that the answers will be easier to find when doing a Google/Bing for the question.

But that will be part two of this short series

You ARE Google/Bing-ing stuff related to your question before asking it, right? Let’s talk about that first, I guess

Searching/Searching/For So Long

Let’s say that you’re working on some code and you get stuck. What do you do?

Let’s take a look at what my thought process is

which isn’t the only way to do it

  • Is there someone around that I can ask about it?
  • Is there someone I have on Slack or Twitter, that I can ask about it?
  • What keywords do I need to Google/Bing in order to get an answer to this?
  • Can I create a minimal viable, repeatable version of the code?
  • Can I write an overview of my issue in the form of a question?
Is there someone around that I can ask about it?

If I’m at work, or working on something with some of my developer friends, then I’ll ask someone if they have a moment for me to talk through the issue I’m facing. This goes hand in hand with creating the minimal viable, repeatable version, because I limit myself to two minutes in describing the issue that I’m facing – after all, I don’t want to take up too much of their time.

This is sometimes called Rubber Duck Debugging, and it comes from a story in the Pragmatic Programmer

if you’re serious about your craft and you haven’t read this book, then you need to remedy that right away

the basic crux is that by sounding out the issue, you end up talking around it and, more often than not, figuring it all out as you’re explaining it. This doesn’t always work, but it can lead you down the path towards the solution and help the other person to ask you questions which will take you the rest of the way.

it’s also one of the reasons why I used to have a Kermit the Frog plushy on my desk

Is there someone I have on Slack or Twitter, that I can ask about it?

If I’m at work and everyone is out to lunch (or in meetings or something like that), then I’ll pull up the work Slack and ask if there’s anyone in our remote office who would mind me telling them about my issue. When I’m not at work, I’ll do the same thing, but I’ll ask on a few of the developer Slack groups that I’m part of. Inevitably, someone will be willing to listen.

I’ll use the same rubber ducking technique but with Slack. Usually this works out a little better than in person, because I have to choose my words carefully, and I’ll often backspace through a whole message and replace it with something more detailed.

Another thing that I’ll do when not at work, is I’ll ask on Twitter. Something like:

It’s not a .NET Core specific question, but it’s for something that I was working on as I wrote this article

In fact, asking on Twitter is one of the things we brought up on the recent Productivity in Tech round table and you should totally be doing it.

What keywords do I need to Google/Bing in order to get an answer to this?

Taking the previous steps further: we already have a high level description of the issue which we’ve shared with other people, now we just need to split it into keywords which will work well with a search engine

You’ll have noticed that I’ve used the phrase “Google/Bing” so far. That’s because I want to be search engine agnostic, but you could just as easily use Duck Duck Go or something similar.

Let’s take a look at my tweet from eariler:

And here’s a list of keywords that I would use for searching with:

  • wordpress
  • custom settings page
  • dynamic settings

I’ll then plug them into a search engine and have a look at the first set of results, and I’ll alter my keywords if nothing seems to match. I’ll iterate on that for about half an hour until I either get some resources which points me in the right direction, or get nowhere.

This is an incredibly difficult step, because you’re taking a very specific issue and breaking it down into a small subset of words. Some people will search using the full string or question and will get the results that they’re looking for. SEO is a massive subject, and some of the things that Google and Bing do to profile you and return what they think are the most relevant results can get in the way.

Can I write an overview of my issue in the form of a question?

This is the difficult bit, and it’s going to be mostly subjective.

The first thing that you need to do is take a look at Stack Overflow’s page on how best to ask questions. Then I’d recommend taking a look at Jon Skeet’s blog post on writing the perfect question.

Once you’ve read both of those pages, you need to take a look back at the information you’ve collated in the previous steps. In most cases, you should be able to craft three statements:

  • Here is what I’m trying to achieve – with a minimal, repeatable code sample
  • Here is what I have tried
  • Here is what I have searched, and why the things I’ve found haven’t worked for me

The question “Why is it faster to process a sorted array than an unsorted array?” (by Stack Oerflow user GManNickG) is a perfect question, and you can see why it’s had so many upvotes. It is clearly divided into sections:

  • First a block of code
  • Then some theories and assumptions – with they themselves then prove wrong
  • A collection of small questions

Sure, the code in this question is based on C++ and Java

so it’s not that well suited to the subject of this blog

but it’s almost perfect.

Imagine that you knew nothing about C++ or Java

I certainly don’t know much about Java, and my C++ knowledge is subpar at best

if you read through the question, you’d still be able to follow along with GManNickG’s line of thinking and enquiry, right? Could the same answer have been crafted if the GManNickG had simply put:

  • Why is it faster to process a sorted array?

You probably couldn’t, could you? I mean, you could take a stab in the dark and provide your own metaphor and code block. But GManNickG’s code block gives the potential answerer more than enough information for them to provide not only the correct answer, but a little computer science theory to explain it based on their understanding of GManNickG’s understanding of the problem.

The next time someone at work asks you to help them with something, pay attention to how they put their problem across to you – even if it’s not a technical question. Take a look at how different people ask questions, too. You’ll find that the folks who get their questions answered the quickest will often be the same folks who provide a lot of context in their questions.

Children can be particularly bad at this. Have you ever gotten stuck in a “why?” loop with a young child? They’re trying to understand the world, and they’re asking you questions, but they don’t provide anything other than a single word question (“why?”), so you get frustrated and send them away

or is that just me?

After all, it’s not just about solving the issue, it’s about learning why a particular thing solves the issue. If you don’t learn why it solves the issue, then you’ll never remember how to solve the same issue when it comes up again

because it will

and you’ll be doomed to start the whole process again.

As I hinted at towards the end of this article, this advice

and remember: it’s just advice, you don’t have to take it

extends beyond Stack Overflow. You should really be thinking about how you ask questions if you really want to get the best answers. There is a great blog post on the Cynical Developer blog

you’ll remember that I was on their podcast, way back when

all about communicating clearly, and I would recommend that you go read it if you’re at all interested in becoming a better speaker, listener, and question asker. It’s not long

at least, not as long as the majority of my blog posts ever are, and if you’ve made it this far…

and there’s a lot of really useful information there.

I also think that asking questions falls under the realm of soft skills, as such John Sonmez’s book “Soft Skills: The Software Developer’s Life Manual” can be very helpful in sharpening some of the key soft skills required for asking the best questions.

If this post has helped you out, please consider   Buy me a coffeeBuying me a coffee
Jamie Taylor
A .NET developer specialising in ASP.NET MVC websites and services, with a background in WinForms and Games Development. When not programming using .NET, he is either learning about .NET Core (and usually building something cross platform with it), speaking Japanese to anyone who'll listen, learning about languages, writing for his non-dev blog, or writing for a blog about video games (which he runs with his brother)