Alex Rivera | Logout

Best ways to teach a beginner to program?

Asked 2008-08-06T05:01:16.677
324

Original Question

I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. (And he actually wants to learn). I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized. (But the answers to this post have helped a lot.)

What can I do better to teach him effectively? Is there a logical order that I can use to run through concept by concept? Are there complexities I should avoid till later?

The language we are working with is Python, but advice in any language is welcome.


How to Help

If you have good ones please add the following in your answer:

  • Beginner Exercises and Project Ideas
  • Resources for teaching beginners
  • Screencasts / blog posts / free e-books
  • Print books that are good for beginners

Please describe the resource with a link to it so I can take a look. I want everyone to know that I have definitely been using some of these ideas. Your submissions will be aggregated in this post.


Online Resources for teaching beginners:

8 Answers

30

You could try using Alice. It's a 3D program designed for use in introductory programming classes.

The two biggest obstacles for new programmers are often:

  • syntax errors
  • motivation (writing something meaningful and fun rather than contrived)

Alice uses a drag and drop interface for constructing programs, avoiding the possibility of syntax errors. Alice lets you construct 3D worlds and have your code control (simple) 3D characters and animation, which is usually a lot more interesting than implementing linked lists.

Experienced programmers may look down at Alice as a toy and scoff at dragging and dropping lines of code, but research shows that this approach works.

Disclaimer: I worked on Alice.

answered 2008-08-06T05:29:49.240
12

Begin with Turtle graphics in Python.

I would use the turtle graphics which comes standard with Python. It is visual, simple and you could use this environment to introduce many programming concepts like iteration and procedure calls before getting too far into syntax. Consider the following interactive session in python:

>>> from turtle import *
>>> setup()
>>> title("turtle test")
>>> clear()
>>>
>>> #DRAW A SQUARE
>>> down()        #pen down
>>> forward(50)   #move forward 50 units
>>> right(90)     #turn right 90 degrees
>>> forward(50)
>>> right(90)
>>> forward(50)
>>> right(90)
>>> forward(50)
>>>
>>> #INTRODUCE ITERATION TO SIMPLIFY SQUARE CODE
>>> clear()
>>> for i in range(4):
        forward(50)
        right(90)
>>>
>>> #INTRODUCE PROCEDURES   
>>> def square(length):
        down()
        for i in range(4):
            forward(length)
            right(90)
>>>
>>> #HAVE STUDENTS PREDICT WHAT THIS WILL DRAW
>>> for i in range(50):
        up()
        left(90)
        forward(25)
        square(i)
>>>
>>> #NOW HAVE THE STUDENTS WRITE CODE TO DRAW
>>> #A SQUARE 'TUNNEL' (I.E. CONCENTRIC SQUARES
>>> #GETTING SMALLER AND SMALLER).
>>>
>>> #AFTER THAT, MAKE THE TUNNEL ROTATE BY HAVING
>>> #EACH SUCCESSIVE SQUARE TILTED

In trying to accomplish the last two assignments, they will have many failed attempts, but the failures will be visually interesting and they'll learn quickly as they try to figure out why it didn't draw what they expected.

answered 2009-02-25T21:00:08.037
2
answered 2010-12-08T16:58:37.297
1

I think that once he has the basics (variables, loops, etc) down you should try to help him find something specific that he is interested in and help him learn the necessities to make it happen. I know that I am much more inclined and motivated to do something if it's of interest to me. Also, make sure to let him struggle though some of the tougher problems, nothing is more satisfying than the moment you figure it out on your own.

answered 2008-08-07T22:12:54.220
1

A good resource to teach young people is the free eBook "Invent your own games with Python":

http://pythonbook.coffeeghost.net/book1/IYOCGwP_book1.pdf

answered 2008-09-01T13:21:44.107
0

One I used with my kids is CEEBot. It's not python, but it teaches C / Java style programming in a fun, robot-programming kind of game. It is aimed at 10-15 year olds, but it is a really good one.

answered 2008-09-06T16:42:22.583
0

A couple of other starting platforms:

  • A good programmable calculator (that's what I learnt on back in the 70s), and HP25 then HP41, now TI69, etc.
  • Interactive Fiction platforms, like "Inform 7" provide another angle on the whole thing
  • Flash/ActionScript

All of these are different and engaging, and any one of these might spark the kind of interest that is required to get a beginner of and running.

LBB

answered 2008-09-16T06:51:29.003
0

Whatever language and environment you choose, if the student wants to learn for professional reasons or to do "real" programming (whatever that is), have them start by writing their starter programs1 on paper and taking them away to run. Come back with the output and/or error results and have them fix things on paper.

This isn't especially harder at first than doing it on-screen and hitting run, but it will make things much easier when they start to discover the wonderful world of bugs.

1) short, "Hello, World!"-type programs that still have some logic and/or calculations, do this up to a few programs that can have bugs

answered 2008-09-21T22:27:48.920

Your Answer