Help, I'm Stuck

September 18, 2013

As a novice to programming, one of the most common places I find myself in is one of despair. There are many things you need to know to program effectively and early on, try as hard as you might, it’s inevitable to run into problems; that’s part of the learning process. Programming is entirely problem solving, and the key to this whole game is figuring out how to climb out of the ditch you’re in.

One of the easiest ways you can do that is by asking someone for help. But this can be quite intimidating. Often times you feel like you never get the answer you want, and when someone eventually responds, they are quite rude. The first time I posted a question on StackOverflow, I put in a thank you note because I felt that was common courtesy. Instead of getting a response, my question was edited to take the “Thank you in advance!” out and was told to limit my posts to information only.

The seemingly rude response kept me from asking anymore questions on the forum and from then on, for the near future, I tried my best to figure out things entirely on my own. Only as a last resort did I pose a question to someone else. In retrospect, this was the best thing that could have happened to me. Only then did I really start learning.

As part of my job at Treehouse, we moderate a Forum, helping all our students with any questions they have. Often times however, it’s hard to help a student, not because the question is a difficult one, but because they don’t really know how to phrase their questions in a way that will get them good answers. The second, unfortunate problem, is that when they ask a question, they’re expecting a direct answer.

Teachers don’t have a problem with giving you a direct answer of course, but in asking them to do so, you’re really doing yourself a disservice because you’re not allowing any learning to happen. Your brain can’t make any neural connections or any of that cool science stuff. Solving the problem yourself is when you allow the magic to happen.

As a novice myself, I’ve established a good pattern when digging myself out of problems, and I feel like it’s good advice to pass on. A lot of this stuff has already been written on the web in different places so I’ll try my best to bring it all together. So without further ado, here’s my guide, as a novice programmer, on general ways to get unstuck, and how to let the learning happen.

Google It

The obvious answer first.

When you run into a problem, there is a very high chance that someone else has encountered it as well. Unless your problem is really complicated or really unique, someone else has already probably asked it and gotten an answer. Your first objective should be to find that answer.

If the first try doesn’t yield an answer, don’t give up. Maybe your query was too broad, or maybe it was too narrow. Phrase your search query differently and see if that works. Don’t just click the first link expecting results either. Navigate through the search results. Some may be similar to your problem and while not the exact situation, could provide you with the guidance you need to solve your issue.

Google is a powerful tool but most of us barely scratch the surface when we use it. Here’s a good guide on how to start using Google a bit more effectively. Maybe that will help you get better results.

Before joining Treehouse, I was under the illusion that programmers knew everything off the top of their heads and rarely ever looked up stuff. I soon learned that part of being a real developer is Googling, constantly learning about things and looking things up. So don’t be afraid to keep searching till you find an answer, even if it takes you hours. The longer you’re frustrated, the more sweet the ah-ha moment is (to me at least).

Read the Documentation

Documentation is written with the explicit purpose of helping you navigate a language. It is the most direct source of information regarding a language and the environment you’re working in, but for a novice, it’s not super user friendly. We’re used to nice, well explained tutorials with hints and whatnot whereas the docs are straight to the point with barely any examples. It’s ok. Refer to it frequently and in time and with more use, you will be able to easily navigate your way around these dense documents.

Often times, a far easier way of getting information from the docs is to use Google, rather than reading the docs manually. If you want to find out how to append an item to a list in Python, you could manually sort through the documentation, which could take you quite a while, or you could Google “python list append”. The first result is all you need.

Browse Forum Archives

There are plenty of forums dedicated towards whatever you are learning. Spend some time looking through the archives for an answer. Again, you could do this manually, but Google is your best friend. One of the most popular (and my preferred forum) is StackOverflow. Usually when you Google a programming question, the top results are already from StackOverflow. But if for some reason you can’t find answers, just add the specific forum name to your Google query. In the guide I provided above, they indicate that you can use Google to search within a specific site. To look up all tableView related questions on StackOverflow, Google “site:stackoverflow.com iPhone UIAlertView”.

Experiment

Probably the best thing you can do once you have some idea of what went wrong is to experiment. Learn by doing. Break things often and figure out what you went wrong. The beauty of programming is that it’s free to break things and free to keep going.

Ask a Friend

If you happen to have friends who are more than happy to help you (hello @benjakuben & @paradoxed) then use their time well, good help is often hard to come by.


Asking Questions

If all else fails, then it’s time to ask the wonderful folks on the web. Asking questions in the right place can be one of the quickest ways to get your problem resolved, but a lot of novices can approach it the wrong way and get spurned. It is extremely important to write well thought out, clear questions that go straight to the heart of your problem. It’s not that these people get pleasure in reprimanding you, you just have to keep in mind that they’re helping you for free and if you waste their time with back and forth answers, they’re just going to get annoyed and leave you alone. Anyway, without making it sound any more dramatic, here’s a few tips on how to go about structuring your questions.

What have you tried?

Before you pose a question, make sure you’ve gone through our first list and at least tried some or all of those methods. One of the most important skill sets as a programmer is the ability to work through a problem. By not trying to work out something on your own first, you’re giving the community the impression that you just want the answers handed to you, and this goes against their nature.

Given that you’ve tried to figure out things on your own, start your question by explaining what you’ve tried and what doesn’t work. Don’t talk about general high level problems, instead explain what exactly is wrong right away.

Details

Context is very important. When you’re explaining your problem, don’t make people dig for information. Providing the context in which things aren’t working will allow someone to give you a direct answer rather than making them go back and forth for a while.

Lots of Code

Post as much code as possible. I’ve seen plenty of questions where someone has to ask for the code before they can help you out. First, if you’re trying to solve a problem with your code, how can someone help you if you don’t provide said code? Second, take time to appreciate that these people are willing to hold your hand and patiently ask for your code. Don’t test their patience. :)

Research

If someone gives a very curt answer, don’t just assume they’re being rude and start writing up your annoyed response. It might just be that your problem has a very simple solution that requires a short answer.

Regardless of how someone delivers their answer, take the time to research it, try and implement it and figure out how it relates to your problem before asking for any more details. There are times when you just want an answer, but most times, being pointed in the direction is the best thing that can happen for your learning process.

Be Polite

Finally, ask nicely. On most forums, people are helping you for free. Don’t pester people if they don’t get back to you on time and don’t be bothered if they sound like the last thing they want to do is help you. Remember that it’s a person on the other end of the line, just like you and is taking up precious time to teach and help you. Be appreciative.

It took me some time to understand how to ask good questions and hopefully this should serve as a useful guide for those in the same place as me.

Reference material and further reading