Best ways to teach a beginner to program?

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:

  • A Gentle Introduction to Programming Using Python
  • How to Think Like a Computer Scientist
  • Alice: a 3d program for beginners
  • Scratch (A system to develop programming skills)
  • How To Design Programs
  • Structure and Interpretation of Computer Programs
  • Learn To Program
  • Robert Read's How To Be a Programmer
  • Microsoft XNA
  • Spawning the Next Generation of Hackers
  • COMP1917 Higher Computing lectures by Richard Buckland (requires iTunes)
  • Dive into Python
  • Python Wikibook
  • Project Euler - sample problems (mostly mathematical)
  • pygame - an easy python library for creating games
  • Invent Your Own Computer Games With Python
  • Foundations of Programming for a next step beyond basics.
  • Squeak by Example
  • Snake Wrangling For Kids (It's not just for kids!)

  • Recommended Print Books for teaching beginners

  • Accelerated C++
  • Python Programming for the Absolute Beginner
  • Code by Charles Petzold
  • Python Programming: An Introduction to Computer Science 2nd Edition

  • This thread is very useful to me as a beginner (>100 lines of code) programmer.

    Based on what I have been through, once I finished with the "Hello World" and move to variables and "if/else" statement, I got zapped with too much syntax; not knowing what to do with them.

    So with an interesting simple project, I might get my interest up again. There are quite alot of project suggestions here.

    Can I ask a questions here?

    Is it better to learn a scripting language like Autohotkey first?

    Edit: [Justin Standard]

    I think learning something macro-based like Autohotkey will only help minimally. Try learning a "real" programming language first. The easiest to get started with (according to most people) are python and ruby. I favor python, but both are pretty simple. There is also a full stackoverflow post that answers the question of which language to start with.


    In my biased opinion, C is the best point to start. The language is small, it's high level features are ubiquitous and the low level features let you learn the machine.

    I found the C Primer Plus, 5th Edition very helpful as a beginning programmer with almost no programming experience. It assumes no prior programming experience, fun to read and covers C in depth (including the latest C99 standard).


    For me, exploring and experimenting within the IDE itself helped me to learn Java and Visual Basic, but I learnt the basics of programming the hard way: Perl 5. There wasn't a free IDE back then, so it meant typing codes into Notepad, saving it, and then run the perl interpreter.

    I'd say that IDEs make learning the basics of programming easier. Try playing around with control structures and variables first. Say in Java:

    int a = 5;
    
    for (int i = 0; i < a; i++) {
         System.out.println("i is now " + i);
    }
    

    Basically, simply learning the control structures and variables would allow a beginner to start coding fun stuff already.

    链接地址: http://www.djcxy.com/p/54294.html

    上一篇: 在<10行简单代码中可以做的最酷的事情是什么? 帮助我激发初

    下一篇: 教新手入门的最佳方法?