Live data from Hacker News

Kids Coding: Simple Java

murrayc.com

11–20 of 31 posts

Re: Kids Coding: Simple Java

#11
post #4

How 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

Brother 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.

Re: Kids Coding: Simple Java

#12
post #4

How 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

Brother 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.

Re: Kids Coding: Simple Java

#13
post #6

I wrote a book (free minimum price) to teach my son programming, starting in Terminal, and using Ruby. 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…

On Linux, there's `espeak`, which is essentially equivalent to `say` on Mac.

Somehow I don't think he was too worried about 9-14 year olds using Linux. Probably was mostly thinking about Windows.

Re: Kids Coding: Simple Java

#14
post #13
post #6

Earlier quoted context omitted.

On Linux, there's `espeak`, which is essentially equivalent to `say` on Mac.

Somehow I don't think he was too worried about 9-14 year olds using Linux. Probably was mostly thinking about Windows.

Espeak claims to also run on Windows (and other platforms): http://espeak.sourceforge.net/

Re: Kids Coding: Simple Java

#15
post #4

How 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

I do not see Python as the natural choice for a first language. I've even had adult colleagues squint when I tried to explain decorators, or objects and all the self/static/class/method binding nonsense.

OOP in Python is something I really cannot like. I teach the language to children and as soon as I get to objects (which is not avoidable in Python, as many libraries and the language itself use objects) the number of concepts I have to explain is too much and I get the dreaded blank stare. I haven't so far found a short explanation that gives them a good enough grasp on objects that they can start making their own.

Ideally I would like to have to explain few orthogonal concepts, as learning a new concept in the abstract is hard and their mind has little patience for it, and let them experiment as soon as possible. But experimentation needs the minimum mastery required to combine the concepts and get some result. Pyhton's objects tend to expose their functions+struct guts, which does not help.

And don't get me started on warts like the "global" keyword, which makes simple scripts with global state and a few functions (a step into learning functions and structured programming) a frustrating and buggy process. I still cannot understand async/await enough to be comfortable with it, and if Armin Ronacher doesn't either... Meanwhile, languages like Oz do concurrency, with actual parallelism, beautifully.

I'm starting to think Scheme and Smalltalk would be excellent beginner languages. "Here's how to make an s-expr; these s-expr are applications, these are definitions. Now go."

Re: Kids Coding: Simple Java

#16
In the system we have been working on at 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

Re: Kids Coding: Simple Java

#17
post #15
post #4

How 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

I do not see Python as the natural choice for a first language. I've even had adult colleagues squint when I tried to explain decorators, or objects and all the self/static/class/method binding nonsense. OOP in Python is something I really cannot like. I teach the language to children and as soon as I get to objects (which is not avoidable in Python, as many libraries and the language itself use objects) the number o…

I disagree, I think Python is an excellent first language. While there are many oddities, I think Python lets you ignore them, or defer them to later in the learning process. Python can be pretty much as simple as you need it to be, and I think that's important for teaching programming.

I would not expect to get to objects _properly_ (maybe things like list()) in an introduction to programming course, I think you can get very far with just functions and simple data types.

Then, once you do want to introduce objects, I think Python's class system can be kept simple enough to begin with, and the parts that are inherently tricky (like self) have equivalently tricky parts in most other languages anyway.

I think a course teaching programming that goes into async IO, needs to discuss 'global' (something I've still used only twice in 5 years of Python), talks about decorators, etc, is doing something seriously wrong.

I don't know a lot about Smalltalk, but Scheme is an interesting idea for a first language. I think it could be a good first language, but I would be concerned about what the next step is. Having learnt Python, there are lots of next steps because it has a large and active ecosystem with plenty of opportunities, I'm not sure Scheme has the same, and I feel learning a second language, while Scheme might be good preparation, is not going to be straightforward for someone who has only just learnt to code.

Re: Kids Coding: Simple Java

#18
I 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) {
        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 
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 ...

Re: Kids Coding: Simple Java

#19
post #18

I 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 ) { println("Hello, World!") } Some more examples: // java for (Element element : collection) // kotlin for (element in collecti…

I agree. I have been doing the Kotlin Koans (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)

Re: Kids Coding: Simple Java

#20
Takes 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".
Post reply on HN