51

I'm self-learning iOS development through the iTunes U CS193p course, and I often find myself stuck. I've been trying to get unstuck myself, but it might take me hours and hours to figure out what I'm doing wrong, be it missing a method or not really getting a whole concept like delegation.

I'm worried that I might be wasting too much time, and I'd be better off going to Stack Overflow shortly after I get stuck so I can move on.

In your experience, does quickly asking on Stack Overflow hamper the learning process or improve it?

ChrisF
  • 38,948
  • 11
  • 127
  • 168

8 Answers8

35

When I am working with new developers, I encourage them to come ask questions after five or ten minutes where they are not making progress.

That has two benefits: the first is that they can get help without too much time spent staring at a problem, but they only ask when they are not getting somewhere. If they are learning - even on something that isn't ultimately the answer - they are much more likely to usefully retain that information.

The second is that after about that much time they have to explain the problem to someone else. That solves a huge proportion of problems, because going through it end-to-end in order means you can spot the thing that you missed in your earlier work.

Since it sounds like you are doing this alone, try turning to a stuffed toy, or the clock, or the wall, and asking that about the problem. Explain it as you would to a person, and see if that fixes things.

If it doesn't, and you are not making progress, ask someone. Spending more than five or ten minutes stuck is a waste of your time - unless you go on to do something else, then come back to the problem with a fresh mind.

22

My only addition to everyone else's great answers:

TYPING UP your question into the StackOverflow question interface is a great way to make sure you're thinking through it fully. I can't begin to tell you how many questions I've answered for myself in the process of laying it out clearly enough to ask it properly. The questions I've started and not submitted VASTLY outnumbers those I've actually asked.

So, I'd say go ahead and ask (after searching, of course), just don't be attached to actually hitting "Submit".

Dan Ray
  • 9,116
  • 3
  • 38
  • 49
20

Stack Overflow, and every other Stack Exchange site, has a set of guidelines for asking questions:

  • Do your homework
  • Be specific
  • Make it relevant to others
  • Be on-topic
  • Keep an open mind

"Do your homework" implies that you shouldn't be too quick to ask. "Be specific" implies that you understand the domain of your problem well enough to outline it concisely. If not, "do your homework" applies. "Keep an open mind" implies that you should be ready to explore solutions that you never thought would be relevant to your problem.

So it's not about asking on Stack Overflow, but whether your questions are good. Essentially the required effort is a learning experience in itself. If you do it right, you'll probably learn a couple of new things just by searching for duplicates. If not, ping me, I got a couple of down votes to spare. :P

yannis
  • 39,647
3

Personally, when I started programming I spent a lot of time trying to figure things out. I could spend hours on trying to fix something. I don't see those hourse as not being productive, in those hours I learned how to look for things online and I really gained insight in how my programming language worked. So I think asking too quickly on SO robs you of a learning experience. Getting into programming just takes a very long amount of time.

Then there is a question of how soon to ask, I'd say spending a few hours on a particular problem is not long (note that I come from an academic background, maybe in commercial backgrounds this is less accepted).

And when you do ask a question on SO, invest time into the question:

  • When you have an error, post the exact text of the error. Also post the code that lead to the error, preferably a self contained example that runs on any computer.
  • Show what you have tried already.
  • Mention versions of the software you use: compiler versions, version of python.

These are just a few points. By investing time into a question you respect the people on SO, you use their time for free. More importantly, you structure you problem. This might already solve your problem :).

Just my 2 ct...

1

I believe that the important thing here is to really understand what you're stuck on and to try to get to the principle problem. After you really root down to what the real issue is then using Stack Overflow is one of the first things I do.

But, it isn't asking a question.

It's searching through all the great answers. Chances are the problem you're having right now has been had by somebody else and they already asked your question. If you feel compelled to use Stack Overflow remember that it isn't just a site for you to ask a question when you're stumped. It is also a repository for some really great information on computer programming; use the search function.

If you searched with a couple different terms/keywords and still get nilch, and you've done your homework and have code samples you can show off and you're really sure your question isn't really a duplicate, then by all means ask your question on Stack Overflow. That's what the site is there for last I checked.

1

It's entirely subjective, but here's my basic rules for my usage.

1) Is my house on fire? Obviously, not literally, but is this a problem that needs not just an immediate solution, but an emergency solution. If so, take a crack at it, fail quickly, get the best help possible.

2) Is this something that I can research? If it's something where I've got the time and it's researchable I'll go down that route, and that includes SO as a complimentary resource. SO is great, so is Wiki, so are the other dozens of resources.
Read lots, it helps your understanding when there's different approaches to an issue, but first spend the time trying to see if your existing knowledge can be reapplied to the issue, then you've built yourself a new mental tool.

3) Is this something that falls outside my skill-set/is so obscure that there's probably 100 people who've ever seen it? This happens, and happens often. I'll generally try research for an hour or two then head here or other resources.

I know it's more noble to sit and do the research and spend the time, but often we have time constraints and you use every resource available, even if it feels like 'cheating' the system.

0

"How quickly" is going to be, by its nature, subjective. Everyone's going to have a slightly different opinion.

If you cannot discover the cause of your problem in about 5 minutes of looking at the actual code, I would at least Google it. If a good search doesn't have the answers, then I would start writing your question on SO.

Keep in mind that it's OK not to actually post that question; there have been times when, in putting the question into written words, the solution has presented itself and I didn't have to actually put it to you guys.

KeithS
  • 22,282
0

You can write your question early but you shouldn't post it until you have properly researched the source of your problem. Write the things you have eliminated and how you eliminated them. You should also check for other similar questions and if you really want to post your question, explain why this is not the same question.

If you do that properly you will find that many times you will solve your own problem.

Marcin
  • 530