News for hackers. Stuff that matters.
Re:Ask HN: How should I teach code to kids? by red-indian on Saturday February 18, 2017 @12:12PM (#13675568)
I teach.

I have the kids learn Python between age 9 and 11 depending on when they are interested. We write games and learn the fundamentals of CS by following the curriculum of Rice's "Introduction to Interactive Programming in Python" class designed by Rixner and Warren. It has a Python interpreter and game library that compiles in-browser into javascript, which is a very helpful design for a first class, and for sharing their results with myself, their families, and each other.

Afterwards I encourage those who really enjoy it to learn Java, also using web sources primarily. I intercede when they are stuck but generally they help each other out.

Some of them used to use the Java to write Minecraft mods but that has become a bit more tricky.

There was one student who started to learn Java at age 7, but in general that's too young. If you push things too earlier they don't get a head start. They get burned out and don't want to have anything to do with it any more. You really need to be sensitive to what they are interested in and let them lead.

Most kids when they see others making their own games want to try their own hand at it themselves, so I have managed to create a self-perpetuating cycle.

Learning languages to make games makes sense. Pushing languages to force concepts will be resisted and is counterproductive.

The games approach is nice too because they rapidly learn trigonometry, basic physics, and linear algebra by age 10 or so, and are teaching themselves Calculus on Khan Academy by age 12, as well as researching optics, writing their own shaders and generally doing what most would consider college or graduate level mathematics. Their Java skills also often lead to writing for Android. Some selling their games and other software at a certain point, which helps their families.

It helps that on the reservation I have a great deal of autonomy in what I can do. I've worked in public outside schools before. None of this would be allowed there.

I don't really care for the idea of dumbed down toy languages that can't really be used for production software. Python and Java are well designed enough that they are understandable and usable from the age where they are able to do programming thought. Python is a simpler one to read and use and so we start with that. But Java is very similar and the lessons of Python directly transfer. Java ends up being much more useful for distributable and saleable software, though it is harder as a first language.

Re:Ask HN: How should I teach code to kids? by vram22 on Saturday February 18, 2017 @01:08PM (#13675845)
Interesting. I teach people programming too, both adults and kids - okay not too young kids, say 10th grade or above.

>distributable and saleable software

Do you or they make the Python code into an EXE for sale, using one of the available tools, or sell as source?

Re:Ask HN: How should I teach code to kids? by foopod on Saturday February 18, 2017 @02:52PM (#13676364)
We used Learn to Mod for a junior hackathon, it is like modding Minecraft but with a scratchlike interface. Super cool
Re:Ask HN: How should I teach code to kids? by dmVI on Saturday February 18, 2017 @11:22PM (#13678179)
I did the same in New Zealand and it was a massive hit with the kids! Great site with a series of tutorials, in browser barebones Minecraft game to see the results of your code and a great full version Minecraft setup with dedicated worlds where the code is loaded as book objects inside the game. HIGHLY recommend checking them out: https://www.learntomod.com/

They also offer free teacher and student accounts with the ability to limit time. Can't say enough positive things about the service.

Re:Ask HN: How should I teach code to kids? by enzanki_ars on Saturday February 18, 2017 @02:13PM (#13676159)
In respect to Minecraft, you can use Python to control aspects of the game in the Pi Edition. With Java, the Bukkit/Spigot API isn't too hard to understand, but I'm not too sure about how hard it would be for kids that age. Depends on their skill level and interest.
Re:Ask HN: How should I teach code to kids? by Eridrus on Saturday February 18, 2017 @01:00PM (#13675802)
Why Python rather than JavaScript?
Re:Ask HN: How should I teach code to kids? by beojan on Saturday February 18, 2017 @01:23PM (#13675917)
The real question is "why JavaScript rather than Python?" The only reason JavaScript is so popular is that it runs in the browser. JavaScript is otherwise a pretty poor language, and certainly much harder to learn than Python.
Re:Ask HN: How should I teach code to kids? by sotojuan on Saturday February 18, 2017 @04:38PM (#13676838)
JS is a pretty bad first language to learn—too many quirks and random syntax in the last few years.

Python is dead simple—I recently had to take on a project written in it having never programmed in Python before and I essentially did not have to learn it to get the feature done.

Re:Ask HN: How should I teach code to kids? by darpa_escapee on Saturday February 18, 2017 @06:27PM (#13677267)
I had a similar experience with JavaScript, assuming you make _extensive_ use of ES2017 syntax and features. It's actually very nice, provided you have a compatible browser, but there's a long way to go still.
Re:Ask HN: How should I teach code to kids? by wwweston on Saturday February 18, 2017 @07:04PM (#13677396)
Having used both to teach beginners, I can assure you that your categorical statements are false.

I might give Python an edge for a number of reasons (a shell is a simpler environment than a browser in a number of ways, some of the language features are cleaner), but to say that it's much harder doesn't bear out with my experience. Capable first-timers become productive at about the same rate.

I've found it's mostly experienced developers who trip over JavaScript, because they're carrying a set of expectations and are weirded out when it does something different. Turns out principle of least surprise means different things depending on people's backgrounds.

Feel free to choose to start someone with Python if you prefer it, or if they're likely to want to work in a domain where it makes sense (say, data science), but it's probably not going to change your learn-to-code outcomes much.

Re:Ask HN: How should I teach code to kids? by mixmastamyk on Saturday February 18, 2017 @08:22PM (#13677675)
That ES6 was created, to substantially redesign the language says otherwise.
Re:Ask HN: How should I teach code to kids? by Eridrus on Saturday February 18, 2017 @01:29PM (#13675945)
Running in the browser and having pretty good debugging tools seems pretty useful to me.
Re:Ask HN: How should I teach code to kids? by darpa_escapee on Saturday February 18, 2017 @02:57PM (#13676387)
Compared to other languages and environments, debugging JavaScript can be difficult if you don't have a good idea of what's going on behind the scenes in specific browser versions, the DOM and JavaScript VM. Throw callbacks, Promises, etc into the mix and things get confusing pretty fast.

Comparatively, other languages, like Python, will throw sane exceptions and a meaningful stack trace when something goes wrong.

Re:Ask HN: How should I teach code to kids? by jventura on Saturday February 18, 2017 @01:39PM (#13676000)
Maybe brython can help with that!

https://brython.info/

Re:Ask HN: How should I teach code to kids? by gtycomb on Saturday February 18, 2017 @03:29PM (#13676521)
I helped an 8 year old get started in Python. It was an almost effortless process once we started with Python's Turtle Graphics. He started "innovating" himself when he saw what he could do with loops etc and draw with the Turtle. I initially tried Javascript but I couldn't think of an easy way to get him to the level of Python's Turtle animations as quickly. Python seemed more packaged and modular this way.
Re:Ask HN: How should I teach code to kids? by josephorjoe on Saturday February 18, 2017 @02:49PM (#13676355)
The syntax of Python is sane, which can't really be said of JavaScript.