最初的问题

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

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

我们正在使用的语言是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学习的时候,它对我来说非常有用。好运!

一旦你教会了他们如何编程,他们可能会想学习如何开发软件。 为此,我认为格雷格·威尔逊的软件木工课程很棒。它还使用Python作为学生的语言。

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

http://pine.fm/LearnToProgram/

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

有一本维基百科非常适合学习python。

我不知道其他语言的维基百科是怎样的,但我个人是从2007年2月的维基百科上学习python的

Ps -如果你不熟悉维基书,它基本上是维基百科版本的书籍创作。这有点难以描述,但如果你看了几本书你就会明白它是如何工作的

我不得不与几个初学者(从未写过一行代码)程序员一起工作,今年秋天我将与高中生一起参加一个课后研讨会。这是我找到的最接近文件的东西了。这项工作仍在进行中,但我希望它能有所帮助。

1) FizzBuzz。从命令行程序开始。你可以很快地编写一些有趣的游戏或工具,而且你可以很快地学习所有的语言特性,而不必先学习GUI工具。这些早期的应用程序应该足够简单,你不需要使用任何真正的调试工具来让它们工作。

至少像FizzBuzz这样的项目都是很好的项目。最初的几个应用程序不应该处理db、文件系统、配置等。这些概念只是让大多数人感到困惑,当你只是学习语法和基本的框架特性时,你真的不需要更多的复杂性。

一些项目:

Hello World! Take the year of my birth, and calculate my age (just (now - then) no month corrections). (simple math, input, output) Ask for a direction(Up, down, left, right), then tell the user their fate (fall in a hole, find a cake, ect). (Boolean logic) FizzBuzz, but count once every second. (Loops, timers, and more logic) Depending on their age some really like an app which calls the users a random insult at some interval. (Loops, arrays, timers, and random if you make the interval random)

一旦他们很好地掌握了语言功能,你就可以开始一个项目(简单、有趣的游戏就可以了。)你应该尽量让第一个项目能够在6-12小时内完成。不要过早地花时间去构建它。让他们去设计,即使它很糟糕。如果它失败了,谈谈发生了什么,为什么失败,然后选择另一个话题,重新开始。

从这里开始介绍工具的调试功能。即使你可以通过阅读代码来发现问题,你也应该教他们如何使用工具,然后向他们展示你是如何发现问题的。这有双重目的:教授调试工具和如何在没有工具的情况下识别错误。

一旦项目开始运作,您就可以使用它来引入重构工具。如果你能用一些你从未计划过的简单功能扩展项目,那就太好了。这通常意味着重构和重要的调试,因为很少有人第一次就能写出像样的代码。

一些项目:

刽子手的游戏 尝试机器人(Vex和Mindstorms都是选择)

开始一个真正的项目,可能需要一些时间。使用适当的源代码控制,并强调有一个时间表。像真正的项目一样运行这个项目,如果没有其他的话,它是处理工具的很好的经验。

显然,你需要为每个人调整这一点。我发现最重要的一点是,即使是第一个简单的应用程序也要适用于用户感兴趣的内容。

一些项目:

俄罗斯方块 基于文本文件的博客引擎 更先进的机器人工作