ungemmed: (Default)
ungemmed ([personal profile] ungemmed) wrote in [community profile] intro_to_cs 2009-11-12 05:30 am (UTC)

For what it's worth, when I was first learning to code, I Really Didn't Get It for a while, and I needed to have my friends sit by me and hold my hand and walk me through examples like I was the dumbest person to ever walk the earth.

After a while, though, I did hit critical mass, and the learning curve flattened out a *lot.* I know that "keep on trying, you'll get it" isn't always the most useful thing to say in situations like this, but....

It might be useful for you to, for a while, explicitly write out the pseudocode for anything you want to code. That way, you're forcing yourself to think algorithmically, but you're writing English steps instead of Python ones, so it's a little more familiar.

For example, if you're checking to see that a number is prime, then the pseudocode might look like:

n = the number we're checking
start with x = 2, 'cause it's the smallest prime
while x < n
if n is divisible by x
n is not prime, we can stop checking now
otherwise,
n might still be prime!
set x to the next value to check divisibility with, and run through the loop again

Post a comment in response:

This community only allows commenting by members. You may comment here if you're a member of intro_to_cs.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting