@u9y42 While I don't disagree, I've found a lot of folks who *think* they want to learn programming, then they head to one of these learning sites where they aimlessly do exercises without really internalizing anything. Having a goal is crucial, I think, to finding the answers to your coding issues. In my case, one of my first programs was to print whether a number was prime or composite. Because I wanted the program to run, I had a lot of motivation to keep looking up the issues I was having when my program failed. I think a lot of folks want to want to learn programming (if you knwo what I mean) and having a goal and trying to acheive it is what separates those who want to from those who merely want to want to.
I guess you're right. I suggested Khan Academy largely because it offers an easy, sort of, "what you see is what you get" way of interacting with code; but that's probably not enough to keep everyone going, if they don't have a way to motivate themselves already - as you say, having in mind a simple task you want to complete, or game you want to make, is likely to both keep you motivated and give you an idea of what you need to, and what you want (or don't want) to explore further.