最初的问题

我目前正在教我弟弟编程。他完全是个初学者,但很聪明。(他真的很想学)。我注意到我们的一些会议陷入了一些小细节,我觉得我不是很有条理。(但这篇文章的答案有很大帮助。)

我怎样才能更好地有效地教他?是否有一个逻辑顺序,我可以用一个概念一个概念地运行?是否有什么复杂的问题我应该在以后再讨论?

我们正在使用的语言是Python,但任何语言的建议都是受欢迎的。


如何提供帮助

如果你有好的答案,请在你的答案中添加以下内容:

初级练习和项目想法 初学者教学资源 屏幕视频/博客文章/免费电子书 印刷适合初学者的书籍

请用链接描述资源,以便我可以看一看。我想让每个人都知道,我确实在使用其中的一些想法。你提交的内容将在这篇文章中汇总。


初学者在线教学资源:

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!)


推荐印刷书籍的教学初学者

加速c++ Python编程绝对初学者 Charles Petzold编写的代码 Python编程:计算机科学介绍第二版


当前回答

我认为Python是个好主意。我会给他一些基本的任务让他自己去做,并告诉他,他遇到的任何死胡同都可以通过谷歌来解决。至少对我来说,自己解决问题总比别人告诉我解决方案更好。

一些可能的项目(排名不分先后):

Coin flip simulator. Let the user input a desired number of trials for the coin flipping. Execute it and display the results along with the percentage for heads or tails. Make a temperature converter with a menu that takes user input to choose which kind of conversion the user wants to do. After choosing the conversion and doing it, it should return to the main menu. Here's an example of an extended converter with the same idea: http://pastebin.org/6541 Make a program that takes a numeric input and displays the letter grade it would translate to. It'll end up evaluating the input against if and elif statements to find where it fits. Make a simple quiz that goes through several multiple choice or fill in the blank questions. At the end it will display how the user did. He can pick any questions he wants. Take an input of some (presumably large) number of pennies and convert it into bigger denominations. For example, 149 pennies = 1 dollar, 1 quarter, 2 dimes, and 4 pennies. Create a simple list manager. Be able to add/delete lists and add/delete entries in those lists. Here's an example of a christmas list manager: http://pastebin.org/6543 Create a program that will build and then test whether entered numbers form a magic square (with a 2D array). Here's some sample code, but it should really print out the square at each step in order to show where the user is in terms of buliding the square: http://pastebin.org/6544

我还建议用xTurtle或其他图形模块做一些事情,把事情混合起来,让他不会感到无聊。当然,这是非常多的实践编程,而不是很多人真正使用python的脚本,但我给出的例子几乎直接取自我通过python学习的时候,它对我来说非常有用。好运!

其他回答

首先,像其他人一样开始:使用Hello World程序。这很简单,它让他们对程序的布局有了基本的感觉。试着回想一下你第一次编程的时候,以及一些概念有多么困难——从简单开始。

在Hello World之后,继续创建一些基本变量、算术,然后是布尔逻辑和if/else语句。如果你有一本旧的编程教科书,可以查看一些早期的例子,并让他浏览一下。只是不要一下子介绍太多,否则会让人不知所措。

实际上,我认为应该选择一种指令更少、更简单的语言。我自己在家学习BASIC语言,杰夫也是。这样,您就不必深入研究更复杂的问题,如面向对象编程,甚至如果您不想深入研究过程的话。一旦他能够处理简单的控制流,就可以转向一些更复杂的东西,但只有简单的功能。

也许从两个数字相加的简单程序开始,然后发展到可能需要一个分支的程序,然后可能读取输入并对其做出响应,然后是某种循环,并开始将它们组合在一起。只要从小事开始,然后慢慢做。不要做任何大的项目,直到他掌握了基本知识(否则它可能太令人生畏,他可能会中途放弃)。一旦他掌握了BASIC或者你选择的任何东西,就转向更复杂的东西。

只有我的0.02美元

关键的是,这个人需要有一些他们想要解决的问题。如果你没有一个你想要编写的程序(并且是一些合理且定义明确的东西,而不是“我想要编写下一个Quake!”),那么你就无法学习编程,因为你没有任何激励你的东西。我的意思是,你可以读一本书,粗略地了解一种语言的语法和语义,但除非你有一个你想要编写的程序,否则你永远不会迎难而上。

如果这种推动力存在,那么其他一切都只是次要细节。

这是一本很棒的书,我的小弟弟们曾经学过:

http://pine.fm/LearnToProgram/

当然,最重要的是在读完这本书之后立即开始一个真正有用的程序。

如果你的兄弟有iTunes,他可以下载新南威尔士大学理查德·巴克兰教授的计算机科学入门课程的视频。他是一个有吸引力的讲师,涵盖了计算和C语言的基础知识。如果不出意外的话,让你的兄弟把视频作为背景播放,一些概念可能会通过潜移默化的作用慢慢地吸收进去。:)

COMP1917高等计算- 2008年会议1 http://deimos3.apple.com/WebObjects/Core.woa/Browse/unsw.edu.au.1504975442.01504975444

如果链接不起作用,这里有一个路径:

Home -> iTunes U ->工程-> COMP1917高级计算- 2008会话1