Date: 2009-09-17 07:38:00
Tags: osw
on learning programming

I didn't get as much done on xearth today as I had planned to. Instead, I got involved in a long conversation at chchspace about programming languages, which migrated toward a discussion about a way to introduce programming to young people. For example:

class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, world");
    }
}

is a lot more crap to have to explain (just how long does it take to explain away "public static void main"?) than:

print "Hello, world"

But even then, "Hello, world" is a major let-down as far as a first program goes. My first ever program was a graphics program: It drew a diagonal line from the top left to the bottom right of an Apple ][+ high-res graphics screen. Printing text came later, on an as-needed basis (probably when I first needed to debug something). I think it's important to introduce programming using a medium that's more malleable than plain old ASCII text.

Text is symbolic. By itself, it rarely looks interesting, but it's a representation of something interesting (maybe). It requires a bunch of cognitive processing to go from the letters on the screen, to ideas that are meaningful. When you're learning a new method of expression such as programming, having to apply this extra cognitive load to everything you do (that is, having to read and understand the program output) detracts from the learning process. Young children learn to draw pictures before learning to write words; even Koko can draw pictures.

What's the right answer? Is it Logo? Maybe they were on to something in 1967. Is it Adobe Flex? Silverlight? Yahoo! Widgets? I believe it's likely to be something like that. It is definitely not "public static void main".

[info]nugget
2009-09-16T20:15:32Z
Only if you get the plastic turtle on wheels.
(anonymous)
2009-09-16T21:25:16Z
My daughter is doing well with Scratch (scratch.mit.edu) and is moving towards Alice (alice.org).
[info]kvarko
2009-09-17T00:09:02Z
At work, I've had to do some programming in C++, instead of my safe comfy world of Haskell. And, wow, it amazes me that people can stand having to program in this language day in and day out. I wanted to know how something in the STL worked, so I made the mistake of looking at the source code -- I commented to a coworker that it's stuff like that which gives programming a bad name. If that's all someone ever saw of programming, I wouldn't blame them for running screaming as far away as possible.
[info]kuoirad
2009-09-17T00:25:56Z
LOGO was how I got my start. Then again, I hate programming, and can't do it well at all... ;)
[info]pne
2009-09-17T08:20:03Z

I wonder how many people's first programs were



10 PRINT "JAMES IS A STINKY POO"
            
20 GOTO 10
[info]ivo
2009-09-17T16:48:02Z
Hah, I was just explaining to a coworker how to write a really quick'n'dirty Java class to interact with our software's Java API, trying to focus on functional stuff such as what inputs and outputs do our API methods take.

Discussion got sucked into a "what's the difference between public and private", "why did you declare that variable as static" and the various options in Eclipse's New Class windows... Sigh!

Oh, and Yay Logo, that might have been my first official "language" I was taught in high school in '89 or so...
[info]taral
2009-09-18T23:30:35Z
"public static void main" covers at least 3 of my gripes with Java-like languages. :)

Some people will say "well, it's only a visible cost because the program is small". Well, better languages are better:

main = putStrLn "Hello, world!"
Greg Hewgill <greg@hewgill.com>