6 ms·
Kids Coding: Simple Java
- vortico 9y agoPretty nice "Processing via the command line" trick. The API at https://processing.org/reference/ https://processing.org/reference/ is much more friendly than the Java API at https://docs.oracle.com/javase/7/docs/api/ https://docs.oracle.com/javase/7/docs/api/
- peterarmstrong 9y agoI wrote a book (free minimum price) to teach my son programming, starting in Terminal, and using Ruby. https://leanpub.com/programmingforkids https://leanpub.com/programmingforkids It's currently Mac-only, because of the `say` command, and so that I could write instructions for just one platform. I have ideas about how I'm going to fix that, but that won't be in the near future. My son was about the same age when I started writing it, but the book scales nicely for any 9-14 year old, I think. Please feel free to give your son a copy, and let me know if it's helpful.
- saghm 9y agoOn Linux, there's `espeak`, which is essentially equivalent to `say` on Mac.
- chadrs 9y agoSomehow I don't think he was too worried about 9-14 year olds using Linux. Probably was mostly thinking about Windows.
- yorwba 9y agoEspeak claims to also run on Windows (and other platforms): http://espeak.sourceforge.net/ http://espeak.sourceforge.net/
- pbhjpbhj 9y agoYour comment sound like you think Linux isn't appropriate for 9-14yos ... could you explain, all major OS are pretty much equivalent for simple uses AFAICT.
- khedoros1 9y ago> It's currently Mac-only, because of the `say` command, and so that I could write instructions for just one platform. I have ideas about how I'm going to fix that, but that won't be in the near future. There's a package on Debian Linux based systems called "gnustep-gui-runtime" which (among a lot of other things) provides the "say" command.
- cutler 9y agoHow to turn a kid off programming for life - choose Java as the teaching language. This kid had already started with Python, which is the natural choice for a first language, so why not just: import typing
- yorwba 9y agoYou seem to have missed that his son had already played with Processing, which uses a simplified Java and a painless graphics API that lets you just put some commands in a file and get to a drawing on screen quickly. Also using it for more abstract projects like addition is not really a bad choice. You may also be overestimating how much easier Python is to learn for a complete beginner. When I was 12 or so I discovered Python via RenPy (https://renpy.org https://renpy.org) and although I could type some simple commands into the REPL, even the fact that you could put your code into a file to execute later was non-obvious to me. My experience with Processing was much smoother in comparison. In my opinion, you should focus less on syntax and more on getting to an engaging experience with a fast feedback loop.
- grogenaut 9y agoLets try not to incite language flame wars in a discussion that could be super helpful without it.
- khedoros1 9y agoI started with QBasic and C++ when I was a kid. A lot of my later instruction was in Java, and I don't have a strong argument for why it couldn't've been used as my first language.
- jedimastert 9y agoBrother man, I started out with FreeBASIC and (for some reason) Perl when I was 8 or 9. I really don't think it matters too much.
- jedimastert 9y agoBrother man, I started out with FreeBASIC and (for some reason) Perl when I was 8 or 9. I really don't think it matters too much.
- dajt 9y agoI'm trying to get my kids to play Human Resource Machine. I hate the name but the game is okay. Because it's basically drag and drop assembly language the amount of steps for the challenges quickly rises. That's a bit of a shame, but the upside is it does sort of teach how a primitive computer would work at a low level for a kid who was grabbed by it. The blog author and a commenter make a good point about how back in the day getting the computer to do just about anything was thrilling, whereas now expectations are a lot higher but so is the knowledge and effort required to make that happen. Switching on a computer and getting nothing but a ready prompt somehow made it easier (or more necessary?) to make your own fun.
- eddieroger 9y agoDefinitely necessary. I remember those days, and the realization that I could run an existing program, or I could sit and make my own, and the latter was pretty appealing to me. I picked up Human Resource Machine when it came to the Nintendo Switch a few months ago, and I loved it pretty immediately. I think it does a great job of abstracting out the fact that you're writing assembly, masked by their very dark sense of humor (Little Inferno, anyone?). Whenever one of my friends (other grown-ups, not even kids) say things similar to wishing they knew how to program, I suggest they pick the game up and give it a try. It's like jumping in the deep end, but does a good job of showing how to think like a computer would think.
- dajt 9y agoYeah, it's more for grown-ups who don't know how to code. One of my sons is doing pretty well but I'm keeping a few levels ahead to see what's coming and I'm not sure he'll grok indirect addressing all that easily! Another son is going through Swift Playgrounds and finding that easier to understand. He couldn't get HRM at all but immediately understood what simple functions were for in Playgrounds.
- dgolds 9y agoIn the system we have been working on at https://build.games https://build.games (an engineering platform for kids to learn and make software) we have avoided git and complicated project management systems carefully so far. Sometimes, to really appreciate some tools, one has to live without them first
- cryptos 9y agoI think Kotlin would be a much better language to learn programming. Kotlin avoids much of the noise and is very readable. The hello world example is symptomatic: public class Example { public static void main(String ...args) { System.out.println("Hell, World!"); } } vs fun main(args: Array<String>) { println("Hello, World!") } Some more examples: // java for (Element element : collection) // kotlin for (element in collection) // java (OtherType) somehting; // kotlin somehting as OtherType // java a.equals(b); // kotlin a == b // java Color color = x < 5 ? Color.RED : Color.GREEN; // kotlin val color = if (x < 5) Color.RED else Color.GREEN And some more like constructors just named "constructor", init blocks are name "init", varargs are prefixed with "vararg", type checks with "is", ranges with 1..9, strings wicht embedded variables ...
- Kaylebor 9y agoI agree. I have been doing the Kotlin Koans (https://try.kotlinlang.org/#/Kotlin%20Koans/ https://try.kotlinlang.org/#/Kotlin%20Koans/), and so far it has a lot of nice functionalities that make coding more fun. Just the way it allows you to create an inmutable class in a single line already makes it way easier to read, while also saving time. Compare Java: public class Person { private final String name; private final int age; public Person(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public int getAge() { return age; } } With Kotlin: data class Person(val name: String, val age: Int)
- vertex-four 9y agoStarting in a very-widely-used language is useful though - someone interested in learning further has a wide range of materials, from books to MOOCs, to choose from. Switching from one language to another before they're fully comfortable with the basic ideas of programming is not going to go well.
- lostcolony 9y agoKotlin or not, I feel like Java is just the wrong choice. Even Kotlin, there's a lot of noise to start with. What's a function? What's an Array? What's a String? I have to either explain all those things, or handwave it as "magic; ignore it for right now" to students. I would find that incredibly frustrating as both a student, and a teacher. I TAed an intro to CS class in Python for a number of years. I am rather ambivalent toward Python as a developer, but as a first language to be taught it worked pretty well. There are others, but having the minimum amount of noise for some basic coding examples I think is incredibly helpful (though I admit, I think I'm basically just saying "I think dynamically/optionally typed scripting languages > statically, explicitly typed compiled languages for this task").
- kazinator 9y agoTakes a Java programmer to over-complicate three lines of shell script: processingRun() { $HOME/processing/processing-java --sketch=$1 --run } alias processing-run=processingRun How about just: processing-run() { ~/processing/processing-java --sketch="$1" --run } I suppose things must be hyper-confusing when there is no "public class" wrapping a "public static void main".
- intoverflow2 9y agoAlways feel when a software developer tries to teach coding to kids they seem to more wrapped up in the process and doing things the "correct" way (often over complicating things with typing, language nuance and command line rituals) than actually trying to teach what's really going on and more importantly empowering being able to step off and create something truly of their own which is the path to self sufficient learning. The self initiated work I've seen kids create out of Scratch is seriously impressive and creative.