教儿子学Java有什么好方法
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/255976/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's a good way to teach my son to program Java
提问by Lawrence Dol
OK, so I've read through various posts about teaching beginner's to program, and there were some helpful things I will look at more closely. But what I want to know is whether there are any effective tools out there to teach a kid Javaspecifically?
好的,所以我已经阅读了关于教初学者编程的各种帖子,我将更仔细地研究一些有用的东西。但我想知道的是,是否有任何有效的工具可以专门教孩子Java?
I want to teach him Java specifically because (a) with my strong background in C I feel that's too complex, (b) Java is the other language I know extremely well and therefore I can assist meaningfully without needing to teach myself a new but (to me) useless language, and (c) I feel that managed languages are the future, and lastly (d) Java is one of the simplest of all the languages I know well (aside from basic).
我想特别教他 Java,因为 (a) 我在 CI 方面的深厚背景觉得这太复杂了,(b) Java 是我非常熟悉的另一种语言,因此我可以有意义地提供帮助,而无需自学新的但是( me) 无用的语言,以及 (c) 我觉得托管语言是未来,最后 (d) Java 是我熟悉的所有语言中最简单的语言之一(除了基本语言)。
I learned in basic, and I am open to teaching that first, but I am unaware of a decent free basic shell for Windows (though I haven't really searched, yet since it's not my first choice), and would anyway want to progress quickly to Java.
我学习了基本知识,我愿意先教它,但我不知道有一个像样的免费基本 Windows 外壳(虽然我还没有真正搜索过,但因为它不是我的第一选择),无论如何都想进步很快到Java。
My son is 8, so that's a couple of years earlier than I started - but he has expressed an interest in learning to program (possibly because I work from home a lot and he sees me programming all the time).
我儿子 8 岁,所以这比我开始的时间早了几年 - 但他已经表达了对学习编程的兴趣(可能是因为我经常在家工作,他总是看到我在编程)。
If no-one can suggest a tool designed for this purpose, I will probably start him off with text/console based apps to teach the basics, and then progress to GUI building.
如果没有人可以建议为此目的而设计的工具,我可能会从基于文本/控制台的应用程序开始教授基础知识,然后进行 GUI 构建。
Oh, one last thing, I am not a fan of IDE's (old school text editor type), so I would not be put off at all by a system that has him typing real code, and would likely prefer that to a toy drag/drop system.
哦,最后一件事,我不是 IDE(老式文本编辑器类型)的粉丝,所以我根本不会被一个让他输入真实代码的系统推迟,并且可能更喜欢玩具拖拽/掉落系统。
EDIT: Just to clarify; I really am specifically after ways to teach him Java; there are already a good many posts with good answers for other language alternatives - but that's not what I am looking for here.
编辑:只是为了澄清;我真的很想教他 Java 的方法;已经有很多帖子对其他语言替代品提供了很好的答案 - 但这不是我在这里寻找的。
EDIT: What about Java frameworks for 2D video games - can anyone recommend any of them from personal experience? I like the idea of him starting with the mechanics in place (main game loop, scoring, etc) and adding the specifics for a game of his own imagining - that's what I did, though for me it was basic on a Commodore VIC-20 and a Sinclair ZX-81.
编辑:用于 2D 视频游戏的 Java 框架怎么样 - 任何人都可以根据个人经验推荐其中的任何一个吗?我喜欢他从适当的机制(主游戏循环、得分等)开始并为他自己想象的游戏添加细节的想法——这就是我所做的,尽管对我来说这是 Commodore VIC-20 的基础和辛克莱 ZX-81。
采纳答案by ?ukasz Lew
回答by VonC
You may find some inspiration in this project:
你可能会在这个项目中找到一些灵感:
Teaching Kids Programming: Even Younger Kids Can Learn Java
Java Programming for Kids, Parents and Grandparents.
面向儿童、父母和祖父母的 Java 编程。
You can find here at the faratasystems web site(direct link here)
您可以在faratasystems 网站上找到(直接链接在这里)
Amongst the lessons learned during such a project, the author mentions:
在这样一个项目中吸取的教训中,作者提到:
Most of the programming tasks require minimal knowledge of arithmetic and algebra skills. To start programming, a kid needs to understand what x = y+2 means. Another important concept to understand is an if statement.
Kids develop the abstract reasoning abilities by the fourth-fifth grade, and they also easily perform such tasks as browsing the Web, downloading and installing software. Dave have learned how to type, compile and run Java programs in Eclipse IDE in no time.
Kids learn much faster than adults, but they do not have "previous programming experience", which may actually be a good thing, because they do not have to switch from a procedural to object-oriented way of thinking. After learning about inheritance, Dave called my wife a superclass.
Adults are responsible creatures, and they can keep doing boring operations much longer that kids. Programming lessons with kids have to be short. One or two 45-minute lessons per week is enough. High school kids should be able to study more, but I do not have such experience yet.
Illustrations help. In my book I've included lots of color cartoon-like characters that are like a Java-fabric softener.
Kids like to see immediate results and enjoy playing with shorter programs, for example a class Fish has a method dive(int howDeep). Let me try to call this method several times with different arguments...
Graphical programming is the most fun, and even a fairly large program like Calculator, Tic-Tac-Toe or Ping Pong can be explained to children.
大多数编程任务需要最少的算术和代数技能知识。要开始编程,孩子需要了解 x = y+2 的含义。另一个需要理解的重要概念是 if 语句。
孩子在四年级五年级发展抽象推理能力,他们还可以轻松完成浏览网页、下载和安装软件等任务。Dave 很快就学会了如何在 Eclipse IDE 中键入、编译和运行 Java 程序。
孩子们的学习速度比成人快得多,但他们没有“以前的编程经验”,这实际上可能是一件好事,因为他们不必从面向过程的思维方式转变为面向对象的思维方式。在了解了继承之后,Dave 称我妻子为超类。
成年人是负责任的生物,他们可以比孩子们更长时间地进行无聊的操作。与孩子们的编程课程必须很短。每周一两节 45 分钟的课程就足够了。高中生应该可以学习更多,但我还没有这样的经验。
插图有帮助。在我的书中,我包含了许多类似 Java 织物柔软剂的彩色卡通人物。
孩子们喜欢看到立竿见影的结果并喜欢玩更短的程序,例如 Fish 类有一个方法潜水(int howDeep)。让我试着用不同的参数多次调用这个方法......
图形化编程是最有趣的,即使是计算器、井字游戏或乒乓球等相当大的程序也可以向孩子们解释。
回答by Jon Skeet
Find something that would be interesting to him as a project, particularly if you can work out a way of it not involving a GUI. I believe that GUIs help to get people interested, but they're fundamentally hard - trying to learn both a GUI framework and a language at the same time is too much, IMO. I like console programs - a short console program has everythingright in front of you, so you can understand every single character relativelyeasily.
找到他感兴趣的项目作为一个项目,特别是如果你能找到一种不涉及 GUI 的方法。我相信 GUI 有助于引起人们的兴趣,但它们从根本上说很难 - 尝试同时学习 GUI 框架和语言太多了,IMO。我喜欢的控制台程序-简短的控制台程序拥有的一切在你的眼前,这样你就可以了解每一个字符相对容易。
For instance, if he's interested in football you might have a text file with results in, and make a project which read in the data, worked out who had how many points etc.
例如,如果他对足球感兴趣,您可能会有一个包含结果的文本文件,然后创建一个项目来读取数据,计算出谁有多少分等。
EDIT: Another thing to think about based on VonC's point about "let's try ..." - perhaps start with an interactive language such as Groovy (which is very like Java) or find a "Java shell" of some description to allow your son to "explore" the language by executing things immediately.
编辑:基于 VonC 的关于“让我们尝试......”的观点考虑的另一件事 - 也许从诸如 Groovy(非常像 Java)之类的交互式语言开始,或者找到某种描述的“Java shell”以允许您的儿子通过立即执行事物来“探索”语言。
I'll be very interested to watch this thread - I really want to teach my kids to program in a few years, and I'd like to write an introductory C# book before then...
我会很感兴趣地观看这个线程 - 我真的很想在几年内教我的孩子们编程,我想在那之前写一本介绍 C# 的书......
回答by AlexJReid
I know you asked for Java, but I am going to go out on a limb and suggest looking at the Ruby-based Shoes: http://shoooes.net/and http://hackety.org/press/
我知道您要求使用 Java,但我打算大胆尝试并建议查看基于 Ruby 的鞋子:http: //shoooes.net/和http://hackety.org/press/
I believe it was originally written as a teaching aid.
我相信它最初是作为教学辅助编写的。
If I was a kid learning to program, this would interest me.
如果我还是个学习编程的孩子,这会让我感兴趣。
回答by Toon Krijthe
This question is similar to https://stackoverflow.com/questions/165905/how-and-when-do-you-teach-a-kid-to-code#165909.
这个问题类似于https://stackoverflow.com/questions/165905/how-and-when-do-you-teach-a-kid-to-code#165909。
My oldest is also 8 and I know he has the right brain for programming but he takes his time. I think you should keep the assignments small but they must have early results. Else they can get disapointed.
我最大的也是 8 岁,我知道他有适合编程的大脑,但他很花时间。我认为你应该保持小的作业,但它们必须有早期的结果。否则他们可能会失望。
回答by Aditya Mukherji
i would try python because
1) Python comes with a decent REPL - Idle .. rather than writing long files of code, javacing and then javaing it.. having your expression evaluated the moment you put it in might better suit the attention span of an eight-year old... u can still make functions and modules and stuff.. but in a more interactive environment
2) python does not have strict typing and allows you to play with dictionaries and variable-sized linked-lists with very little syntax.. that way.. you could teach him some of the big ideas behind programming first and leave learning lots of syntax for later when he is already very involved in this stuff
check out http://openbookproject.net//thinkCSpy/
我会尝试 python,因为
1) Python 带有一个不错的 REPL - Idle .. 而不是编写长代码文件,javacing 然后 javaing .. 在你放入它的那一刻评估你的表达式可能更适合一个人的注意力范围八岁了……你仍然可以制作函数和模块之类的东西……但在一个更具交互性的环境中
2) python 没有严格的类型,允许你用很少的语法来玩字典和可变大小的链表..那样..你可以先教他一些编程背后的重要思想,然后在他已经非常参与这些东西的时候学习很多语法,
看看http://openbookproject.net//thinkCSpy/
回答by user21714
Have you looked into BlueJ? I know you said you're leaning against IDE's but it is an IDE specifically geared towards teaching Java. Also it seems to have some things that an 8 year old might find cool like graphical representations of class structures.
你研究过BlueJ吗?我知道你说过你倾向于使用 IDE,但它是一个专门用于教授 Java 的 IDE。此外,它似乎有一些 8 岁的孩子可能会觉得很酷的东西,比如类结构的图形表示。
回答by Scott Cowan
I know its not java but a friend of mine homeschools his kids and he's using
我知道它不是 Java,而是我的一个朋友在家上学他的孩子,他正在使用
回答by Cervo
I suggest "Programming Video Games For The Evil Genius" by Ian Cinnamon. The author was 15 at the time he wrote the book..... Anyway the book is relatively easy to follow and teaches you how to do some gamelike things with Java. Because let's be honest, most kids want to make video games. Back when I was 10 or so I was making Visual Basic programs that were text based adventure games. This dream of making video games sticks throughout high school. Anyway the book shows a lot that you can do with Java on that front.... Nevermind what a 29 year old would be doing with a book written by a 15 year old whistle. I was 28 when I bought it......
我建议 Ian Cinnamon 的“为邪恶天才编程视频游戏”。作者在写这本书的时候才 15 岁..... 无论如何,这本书比较容易理解,并且教你如何用 Java 做一些游戏般的事情。因为老实说,大多数孩子都想制作电子游戏。在我 10 岁左右的时候,我正在制作基于文本的冒险游戏的 Visual Basic 程序。制作电子游戏的梦想贯穿整个高中。无论如何,这本书在这方面展示了你可以用 Java 做的很多事情......别介意一个 29 岁的人会用 15 岁的whistle写的书做什么。买的时候28岁……
Anyway Java having so many libraries makes it fairly easy to get graphics up. Qbasic had sucky graphics but it had fairly simple calls to turn pixels on and off and draw lines and when I was 12 or 13 a lot of us would just make weird effects with the graphics in QBasic using loops, etc... While it was a complete waste of time, it further helped to strengthen the concepts of iteration, arrays, etc....
无论如何,Java 拥有如此多的库使得绘制图形变得相当容易。Qbasic 有糟糕的图形,但它有相当简单的调用来打开和关闭像素并绘制线条,当我 12 或 13 岁的时候,我们中的很多人只会使用循环等在 QBasic 中的图形制作奇怪的效果......虽然它是完全是浪费时间,它进一步帮助加强了迭代、数组等的概念......
So anyway based on my experience and the experience of my friends who could program at the time, I'd say kids like bells and whistles graphic effects and to create video games. Even text games count. The fact that Java has tons of libraries that do a lot and free the programmer from the implementation details means that if Java was around when I was that young, I would probably have been tinkering with it. Add in a book written by a 15 year old on simple video games in Java (note he's not a normal 15 year old, the kid was a Sophomore at college at the time....so think Child Prodigy) and you have a recipe to hook your kids interest.
所以无论如何,根据我的经验和我当时可以编程的朋友的经验,我会说孩子们喜欢花里胡哨的图形效果和制作视频游戏。即使是文字游戏也很重要。Java 有大量的库,它们可以做很多事情并使程序员从实现细节中解放出来,这意味着如果 Java 在我那么年轻的时候就出现了,我可能会一直在修补它。再加上一个 15 岁的孩子写的关于 Java 简单视频游戏的书(注意他不是一个普通的 15 岁孩子,那个孩子当时是大学二年级学生......所以想想 Child Prodigy)你就有了一个食谱勾起孩子的兴趣。
If Java's verbosity is too much to keep your kid's interest, try Python. I think I remember seeing a library for making 2d games there....... But at the very least it can probably make much better text adventure games than qbasic :)
如果 Java 过于冗长而无法保持您孩子的兴趣,请尝试使用 Python。我想我记得在那里看到过一个用于制作 2d 游戏的库......但至少它可以制作比 qbasic 更好的文字冒险游戏 :)
回答by user33257
I'd go for scheme. Anyway, take a look on this site, it has some Java and pedagogical resources: http://www.teach-scheme.org/
我会去计划。不管怎样,看看这个网站,它有一些 Java 和教学资源:http: //www.teach-scheme.org/
回答by Peter
Once you got your son started you can try CodeInvaders, competition can be very useful to get him thinking, maybe even father-son competition.
一旦你让你的儿子开始,你可以尝试 CodeInvaders,竞争对于让他思考非常有用,甚至可能是父子竞争。