Probably I'm not the only one that considers some questions challenging. Sometimes, I have an idea how to solve it but not how to write the code. So, I was wondering what do you guys do if you get stuck. Do you get off the computer for awhile? Or look at notes (yours or from the course)? If you look at Google or elsewhere how do you find the stuff you need? Please share if you have any tips and tricks. It will be much appreciated :))
asked 25 Jun '12, 07:56
Well that's a good question, and I get stuck in the homework a lot too.
Try to write the algorithm using as many small steps as possible, trust me, it will help in forming a clearer idea.
Once you have a clear enough rough algorithm in front of you, try to write down the code you would use for each of the steps. You will realize how much simpler you can make your program and then try it out in the python interpreter.
But sometimes when I get a question correct after being totally stuck for a long time, my final program isn't as elegant as the one Dave suggests, but it's still correct.
answered 25 Jun '12, 08:38
I revise previous chapters..units!
answered 25 Jul '12, 20:52
My strategies are:
answered 25 Jul '12, 20:36
here is what a i do:
answered 10 Jul '12, 13:30
First I try to go back and look at the sections that taught the material. If that doesn't work, for the unit assignments I briefly look at the answer to get a starting point on the problem and then fill in the blanks. For homework problems, I either sleep on it or get help from looking at similar problems on the internet.
answered 10 Jul '12, 10:11
This is a generally useful algorithm for solving problems in life.
Write down everything that comes to mind. Basically, start get everything you know on paper. This does not have to be code (but it can be). For example, let's say that I know I have to compare these two elements, I'll probably write "I must compare these two elements, if they are equal, that means, Z and so I should do Y" then I'll write out some basic code and then try to do that for all the individual pieces of the code and then I put them together.
answered 09 Jul '12, 14:23
I just remind myself that getting stuck is an opportunity to learn. I try to figure out what exactly is tripping me up. Sometimes I realize I just don't remember the name of a function or a method or some detail in syntax. That's usually easy to fix by doing a google search. If it's a test question I might even look up the solution at this point, since by now I know what I'm looking for.
One technique I love is to try solve an easier related problem. In the problem where you're asked to print a multiplication table to nxn I felt lost first. So I tried to print one from 1x1 to 1xn first. At which point the solution to the original problem was obvious.
For coding specifically, I like to write comments that can be turned into specific code. For example
Then I might realize that I need to save the result along the way and the final line becomes return result. Basically, I try to break down the problem and solve little chunks until the whole doesn't look so intimidating anymore.
This advice is from the mathematician and math educator George Polya.
answered 07 Jul '12, 16:02
I have taken a total of 6 Udacity courses, plus I am currently taking 3 more, and when I finish the Coursera courses I'm taking now, I will have taken a total of 12 courses there (Plus I took a free online course from Caltech, called Learning From Data). So with that said, here is my stragegy (cause believe me, I beat myself over the head so badly on some of the problems I encountered that I almost went into a deep depression at one point and wanted to quit taking all courses for the rest of my life):
Conclusion: So in the rare case that you're like me, just take it easy. Take your time. I read PDFs, blog posts, I go on Stackoverflow, I read Documentation up the wazoo for Python and other programming languages I've started learning (Prof. Norvig says somewhere on his site that we should learn about a half-dozen languages, I will try to find the reference). The point is that I'm in this for the long-haul. I'm in the process of a complete career change. I've been an artist all my life, a painter, a musical composer / sound designer, and an accomplished author. But creativity for the sake of self-expression only has its limitations, for me anyway. I want to build things, I want to solve engineering problems. So every moment that I spend learning something properly from a course at Udacity, that's one moment that I am closer to my end-goal, hence the need, for me anyway, of coming to terms with what my GOAL is in the first place for taking all these courses.
Once again, there will always be tough problems, hard problems, sometimes intractable problems, unsolved "mysteries".. computer science is chockful of unsolved problems.. Trying to write code elegantly and beautifully may take a lifetime of practise. I know, it took me a lifetime of practise to learn to paint and compose music, etc. So now I am taking a "second" lifetime so to speak to learn to program. So my advice is take it easy, relax, move on to something else if you have to.. take the time to truly genuinely understand a problem before moving on, or else you'll end up confused and it won't sit straight with you. There's no other choice but to learn every part carefully before moving on. If the pace of a course is too fast for you, take a break. The course material will still be there next week. Take a break and come back to it later when you feel more prepared. Read some PDFs, some blogs, look at some videos on Youtube (there's material in computer science from every major University on Youtube, and there's Khan Academy and a whole bunch of resources.. podcasts, Codeacademy, etc.) Just go at your own pace and remember your end-goal.
That's my philosophy for Udacity courses right now, if I say so myself. Good luck on your future travels here! :)
answered 05 Jul '12, 20:45
I simply take a short break to refresh myself. Take a walk, read a book, play some video games, do other homework, etc. This also helps to keep you from getting bored from working a little to hard or too long. Also remember, the homework is merely for practice, and is not mandatory.
answered 25 Jun '12, 13:01
I step away, do something else, usually sleep on it and leave until tomorrow.. That way something that totally confusing has had time to "incubate" somewhere in the back of my brain.
..So when I come back to the problem later on, its usually clearer.
In the intervening time I'll try to read up via other sources, going over and re-enforcing what was covered in the lectures. Repetition forces stuff into the longterm memory.
The problem I mostly have, is I might intuitively see how to break a problem down, turning it into steps, but then be endlessly fiddling with the code trying to get it to work.. :(
The problem is when you're 75% right, or 99% right.. Sometimes I've just given up completely, and taken a peek at the solution..
Its discouraging if you just can't get the thing to work, after spending an hour on it.. but after seeing that I was almost there in the Solution, but left one step out, its still far more useful than straight-off googling for the problem, because it forced me to think very carefully about the problem first.
I'll only use Google as last resort - firstly wrangle with the thing, then leave it or do more reading (docs.python.org also constantly open). If its totally discombobulating, I'll google the steps that seem to be causing the blockage.
Then I'll trawl forums here.
Failing that, I'll skip and move on to watching the solution video.
I think its more important to have tried, and almost got it.. usually its a coding error, rather than understanding or logical implementation.
Coding problems will hopefully disappear with more and more practise.
I'm also going to find and work through other problems, to supplement the ones on here, to give myself that practice.
Oh yeah, "targets" and "rewards".. I'll set a target for the day/week.. If I achieve it, I get a treat! Helps with motivation :o)
answered 05 Jul '12, 13:33