最初的问题

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

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

我们正在使用的语言是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编程:计算机科学介绍第二版


当前回答

需要考虑的事情……不是每个人都能编程:

有些人就是忘不了下面这些事情:

A = 1

B = 2

A = b

(这些人仍然会认为A = 1)

杰夫也谈到过这个问题。事实上,我的例子在链接中(并且已经解释了)。

其他回答

我不知道怎样对你弟弟最好,但我知道我是从蟒蛇开始的。我从很小的时候就开始玩各种各样的游戏,并想要制作自己的游戏,所以我的叔叔用pygame库向我介绍了python。它有很多教程,让一切都很简单(在我看来比openGL简单多了)。 它仅限于2d,但你应该从简单开始。

我的叔叔推荐python,因为他当时对它很感兴趣,但我推荐它,现在已经相当有知识了,因为它很容易学,直观(或像编程语言一样直观),而且简单(但肯定不简单)。

当时我个人觉得简单地学习编程非常无聊,但随着学习的深入,我又有了相当大的热情。我真的很想学习是为了创造一些东西,而不仅仅是学习。

My favourite "start learning to code" project is the Game Snakes or Tron because it allows you to start slow (variables to store the current "worm position", arrays to store the worm positions if the worm is longer than one "piece", loops to make the worm move, if/switch to allow the user to change the worm's direction, ...). It also allows to include more and more stuff into the project in the long run, e.g. object oriented programming (one worm is one object with the chance to have two worms at the same time) with inheritance (go from "Snakes" to "Tron" or the other way around, where the worm slightly changes behavior).

我建议您从微软的XNA开始。根据我的经验,如果你能在屏幕上看到一些东西,开始编程就会有趣得多,而XNA使得在屏幕上移动一些东西变得非常容易。做一些小的改变并获得另一种看法是很容易的,例如通过改变颜色,这样他就可以看到他的行动有效果->成功的印象。成功是有趣的,这是不断学习的巨大动力。

My personal experience started back in elementary using Logo Writer (which in a way has evolved into Scratch), granted I was a little kid and computers where not as awesome as they are nowadays, but for the time being it took me places I hadn't been before... I think that's how I got hooked in the business... I could say that it was these first impressions based on such simplicity and coolness that made the goods that stick into my head for life. That's how basics in teaching programming should be taught... a simple process that yearns magic.

回到我的第一个CS 101,我从构建Tequila Sunrise(一个可以在任何时候使用正确的成分重复的一步一步的过程,将产生相同的输出)开始,从那里我们转向使用Scheme的基本数学函数(就像EHaskins说的那样……)从小的开始,然后逐渐增加),然后是循环、布尔逻辑、结构的概念,然后是对象的概念和一些模拟执行……

这种方法的一个好处是,在学习编程概念和基础知识的过程中,语言不是一个目标,而只是一个工具(就像运算符、函数和其他东西在数学中的作用一样)。

IMHO learning the basics of programming and creating a foundation is probably the best thing you could teach your brother, once the goal is covered then u can move on into a more general use language like python and teach them higher concepts like architecture and design patterns (make them natural in the process so he will get use to good practices from early stages and will see them as part of the process)... we are far from reinventing the warm water, but we always have to start by creating fire.

从那里开始,天空就是极限!

如果他感兴趣,那些小细节不就是好地方吗?使用python时,您已经切断了GUI,这样就不会有困惑了。为什么不选择一个项目,一款游戏或其他东西,然后执行它呢?经典的高低数字猜谜游戏可以简单地从命令行中用20-30行代码(当然取决于语言)实现,并为您提供变量、条件、循环和用户输入。

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

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都是选择)

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

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

一些项目:

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