
Why kids don't program - johnaspden
http://johnlawrenceaspden.blogspot.com/2009/11/behold-in-its-full-glory-program-that-i.html
======
zupatol
For me it was exactly the opposite. I started learning programming at 13
reading the zx spectrum manual chapter after chapter until I came to sin and
cos which I did not know. My parents hadn't studied, so they could not tell
me. Instead of just skipping that chapter, I gave up programming. Much later I
studied economics. Working as an economist I discovered the fun of programming
with visual basic, and then decided to become a programmer.

If in 1983 I could have googled sin and cos or read about it in wikipedia, I
would have wasted much less time.

~~~
johnaspden
That makes me feel really sad. My epiphany was your iron curtain coming down.

I can see how. In fact I had the same reaction initially (and my parents are
graduates, but they don't know the first thing about maths, so they were no
help to me either).

I have no idea why I wrote the program to plot a circle that made it obvious
what sin and cos were.

In fact I think I might have misremembered my own story. I had a ZX81 first,
and I don't think that had a circle function, so it may be that the ZX81
manual explained how you could use SIN and COS to do that.

But I think we can agree that google and wikipedia are wonderful things. The
upcoming generations of programmers and mathematicians are going to be Gods.
How could they not be with a library like that!

~~~
billybob
"The upcoming generations of programmers and mathematicians are going to be
Gods. How could they not be with a library like that!"

...because they also have lolcats?

Seriously, there are a lot more distractions these days, too.

~~~
asyazwan
Not just LOLCAT, DailyWTF, etc. but also HN, Slashdot, etc. Not just I waste a
lot of time reading the articles, I probably waste more on reading the
comments... while keep delaying work at hand.

------
Kirby
In reality, I'd wager there's a _lot lot_ more kids programming today than 30
years ago. How many people had a computing device at home back then?

This anecdote makes the point that a very specific kind of thinking was better
suited by the tools of the late 70s, and maybe - I've never been much inclined
towards it, so I dunno.

And what we consider 'programming' is blurrier than it used to be. Is HTML
programming? What if you use a fancy editor like dreamweaver? Only when it
becomes dynamic? Does CSS count? A lot of youngsters, when they aren't getting
off my lawn, have done web stuff, and the fact that it's a gradual shift from
being a user to being a programmer probably makes it even easier.

I find the whole premise of this blog post flawed. (Great Scott! Someone
disagrees with someone else on the Internet!)

~~~
swannodette
And I disagree with you here. Writing declarative HTML and writing a simple
interactive computer game are two activities that could not be more different.

Like it or not, the act of programming has become much more difficult than it
once was. 1988 I could reboot my Apple IIgs, hold down a couple of keys, and I
could start writing a BASIC program immediately.

~~~
tsuraan
And in 1995, I could write interactive (quasi) graphical games on my TI-81.
Without rebooting. At the time, a TI-81 was pretty fancy, but I've seen plenty
that leads me to believe that nearly every kid today has a TI-83 for their
math class. It's not quite basic, but it's certainly programming, and it's
just as easy and accessible as an Apple used to be.

~~~
swannodette
Kids are not fooled. Programming a computer and calculator are also not the
same thing. While I enjoyed hacking on my graphing calculator as well, the
limitations of the calculator (no color, small screen, no keyboard) made it
fairly limited for learning any broader concepts about programming.

~~~
iamwil
The point is access, not completeness. Kids have access to more devices that
are easy to program, just less so their computers.

------
yummyfajitas
It's actually fairly easy to do what he wants today.

    
    
        ipython -pylab 
    
        [...boilerplate...]
    
        In [1]: n = arange(255)
    
        In [2]: plot(n, 88+80*sin(n*pi/128))
    

<http://imgur.com/oSd62.png>

As for the "imaginary diffusion equation" (I assume he means the Schrodinger
equation), here is a simple program which solves it on the torus:

    
    
        from pylab import *
        from numpy.fft import *
    
        def freeSchrodingerSolver(input, dx, dt):
            np = input.shape[0]
            k = arange(np)*2*pi/dx   #Coordinate system in k-space
            k[np/2:] -= np*2*pi/dx   #FFT puts negative frequencies
                                     #on right side of array
            return ifft(exp(complex(0,-dt)*(k**2)/2)*fft(input)) / np
    

I really doubt it was easier to do that on a ZX Spectrum.

~~~
johnaspden
Well, actually,

sudo apt-get ipython sudo apt-get install ipython ipython -pylab sudo apt-get
install pylab sudo synaptic (<\--used it to find pylab packages) sudo apt-get
install python-matplotlib sudo apt-get install python-matplotlib-data sudo
apt-get install python-matplotlib-doc ipython -pylab

And then the program works.

Actually, thanks for that, I didn't know about that stuff, and it looks really
useful. If I can figure out how to get the drawings to move then it will do
what I want. (to visualize the action of unitary matrices on Hilbert spaces)

But my point was that in 1982, my non-technical parents bought me a computer
and then I was away. A couple of months later I had an animated model of the
solar system. And I hadn't read anything except the spectrum manual (and the
equivalent one for the TRS-80).

I can work out how to do the above installation for my hypothetical 12 year
old son, but my poor father wouldn't have had a chance. And I suspect that the
same would be true for most non-techie parents.

And how is the hypothetical son supposed to go from the pretty blue curve
created by the magic plotting program to an animated solar system?

I can't see how to make the graphs move. Perhaps it can be done. Perhaps it
can't and I should use SDL instead.

The point is that it is not obvious to me. Whereas the equivalent questions
were obvious to a child thirty years ago.

~~~
yummyfajitas
Regarding a minimal setup python environment, which requires nothing more than
a newbie parent to download, PythonTurtle or Squeak is probably what you want.

I think the issue is mainly just lack of knowledge that truly newbie friendly
environments exist. Perhaps the solution is simply better advertising of
squeak, or perhaps having it come preinstalled (as OLPC did)?

Incidentally, the animation info you seek (admittedly, not suitable for
newbies):

<http://www.scipy.org/Cookbook/Matplotlib/Animations>

Or, if you want to generate movie files:

    
    
        for i in range(numframes):
            [...code to make frame...]
            savefig("framedir/" + str(framenumber).rjust(8,"0")+".png")
    
        os.system("mencoder -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=1500 -mf type=png:fps=16 -nosound -of mpeg -o movie.mpg mf://framedir/\*.png")

~~~
johnaspden
Thank you so much for that and for your previous post. Exactly what I wanted.

------
neilk
Probably tangential... I learned what sin() and cos() did experimentally.

There was a BASIC program in Creative Computing that used sin() to make a long
snake of text scroll down the screen. So, in my mind, sin() and cos() were
things that made wavy lines.

A little while later I was puzzling over how to draw a circle. I had this
epiphany that the X component was drawing a wave, just like sin(), and the Y
component was drawing a wave that was just out of phase. I went home and
programmed it and it worked instantly.

We had a Britannica at home, so I finally looked up what sin() and cos() were,
and the diagrams made it all obvious.

It's good that we now have Wikipedia and all, but kids today are still
deprived of a computer that comes with a decent programming environment, that
makes fun stuff like graphics dead simple.

~~~
dbz
And when kids download "decent programming environments" they have absolutely
no idea how to use them. =/

That one comes from personal experience.

------
erikwiffin
The crazy thing is, he just told the exact same story about beginning
programming as I would tell. The only difference, is that I'm 21, and my first
experience was drawing circles on a TI-83 graphing calculator in high school.

It has a graphing mode, where you can put in functions and it'll draw them for
you. And it has a programming mode, with a very BASIC-like syntax that I wrote
simple graphing programs, ridiculous text-based rpgs, and my own version of
the oh-so popular Drug Wars.

Having no idea what a ZX Spectrum is, I can only assume that the likelihood of
the author having one 30 years ago is about the same as the likelihood my
having a TI-83 in high school, especially because the calculator was pretty
much required for some of the math classes I was in.

~~~
megaduck
You're right, they're pretty similar. The ZX Spectrum was a little personal
computer, sold in Britain through the 80's. It was pretty cheap, probably the
equivalent of $750-$1000 today. Certainly cheap enough for parents to buy for
a bright young boy.

Since the ZX ran BASIC, programming for the spectrum and your TI-83 is pretty
comparable, although your TI-83 was a bit more powerful. :)

<http://en.wikipedia.org/wiki/ZX_Spectrum>

------
lssndrdn
I am the same age, and I had a very similar experience, especially with
regards to the BASIC manual. I would just go through the list of keywords, A
to Z, skipping the ones that didn't make sense at first, and then circling
back and starting all over until I had them all. In a way, a _limited_ manual
made it easier to circumscribe the problem, and gave my little nerdy self a
"goal": Finish The Book.

I guess the same could be done with the information available on the Internet.
If someone wants to learn javascript they have all the info they could
possibly ever want. There are so many options now. But learning to program is
a question of interest and determination, not availability of information.

------
AlSweigart
I don't agree that programming has gotten harder, I think it has become
easier. What is harder now is finding material to learn programming that is
simple for kids but also still "real" programming (not just game creation
kits).

I wrote a freely available book called "Invent Your Own Computer Games with
Python" and released it under a Creative Commons license. It's available at
<http://inventwithpython.com>

I think Python makes a great (even superior) replacement for BASIC. Adding in
Pygame, and it is much easier and fun to learn programming.

~~~
stevejohnson
I looked over your book at some point and loved it. Thank you for writing
this.

I prefer pyglet over PyGame. I wrote a tutorial for it in the style of your
chapters 16-19. It's up at [1].

[1] <http://www.steveasleep.com/pyglettutorial>

------
benwr
About 5 years ago, in 7th grade, almost the exact same thing happened to me,
but with a TI-83 graphing calculator. I would estimate that there are
approximately the same number of kid programmers as there were. Modern PCs and
macs don't come with compilers or interpreters, and there is no "command
mode". Why would the ordinary kid ever open up cmd.exe, when everything you
could ever want to do on a computer is on the web? I only learned TI-BASIC
because a friend's dad is a hacker. He inspired me to check out the only book
on programming at our school, which happened to be about BASIC. The truth is
that, while kids are closer to computers than they were 30 years ago, they're
not much closer to programming.

~~~
dbz
I started programming around 6th grade, and I am in 11th grade now. I started
because one of my "really smart friends" was doing it. He started because his
dad made his own linux distro .(That's a lie. I know his dad has made his own
linux distro, but I honestly don't know why he started, but I am sure his dad
is the cause of inspiration.) The point is that I am sure tons of people would
love to learn to program if they are simply given the opportunity- the
inspiration (and the tools).

Why would I be sure of this? People have come up behind me and asked questions
like "Wow, that's a really cool word-like program. Where did you get it?" Of
course I tell them I made it and almost always I get asked how. I've even
given out a couple of programming "lessons". (That's a lie. I've given out
hundreds of programming lessons, and I've written at least ten little
programming manuals to help people begin to program.) However, the _real_
point is: If given inspiration, kids are very curious creatures and will start
to program.

------
ajuc
I had c-64 and one of the most frustrating memories from my childhood was that
I couldn't get it to draw anything in a graphic mode. In manual the code to
initiate graphic mode had error in it, or the manual was for different version
of the computer, I still don't know.

Anyway - 8-bit computers were superb "teach-yourself-programming" machines,
but I think novadays kids have internet access, so they will manage :)

PS. I would choose python + pygame to teach a kid graphic programming. It is
simple, interpretted and has interactive console.

~~~
Tichy
Graphical mode on the C64 was difficult, ZX Spectrum was much easier for that.
C64 ended up being the better game engine, though :-)

------
parbo
<http://www.zxspectrum.net/>

------
Tichy
I wonder, is Logo still relevant for children (was it ever)? I know Netlogo or
StarLogo are still in active use in academia (for artificial life/complex
systems research).

I have been toying with the idea to write a Javascript LOGO for the Canvas
Element. There used to be Online-Logo Applets, but I think they were all Java.

At least it might be a fast way to draw nice things programmatically.

~~~
spatulon
This JS-based Logo works nicely: <http://logo.twentygototen.org/>

Here are a few programs I made with it (note that the default is to 'run
normally'. You might want to click 'stop program' and then 'run fast'):

* Sierpinski triangle: <http://logo.twentygototen.org/83EGZPPC>

* Sierpinski carpet: <http://logo.twentygototen.org/4c5iy9iU>

* Sierpinski arrowhead curve: <http://logo.twentygototen.org/hYDSZt8h>

* Hilbert curve: <http://logo.twentygototen.org/CFyUSzqG>

* Hexaflake: <http://logo.twentygototen.org/AJeuVkKc>

~~~
Tichy
Very nice!

------
flatline
There are so many more options than when he was writing BASIC programs on a ZX
Spectrum. Choose something straightforward and stick with it. Python is about
as simple as it gets. PLT Scheme is also a great option, it has a fully self-
contained environment that includes much better graphics options than BASIC
did, and is well-documented. There are lots of others - this post has some
good discussion on a similar topic:
[http://stackoverflow.com/questions/950619/summer-holiday-
pro...](http://stackoverflow.com/questions/950619/summer-holiday-programming-
club-which-language-suits-best)

~~~
swannodette
Having more options means you have to figure out what choose. That doesn't
make it easier, that makes it's harder.

It's also important that there be a lot of reference materials which would be
easy for a kid to teach him/herself with.

For example: [http://www.scribd.com/doc/200861/A-Touch-of-Applesoft-
BASIC-...](http://www.scribd.com/doc/200861/A-Touch-of-Applesoft-
BASIC-1986AppleIIc-IIe-IIGS)

This was the book I read when I was 10 years old. It was also easy to find
BASIC code at the school library and in computer magazines.

How many current general computer magazines still publish useful bits of code
("How to access your mouse from Apple Basic", etc) ?

~~~
yangyang
How many general computer magazines still exist?

The web has made printing code redundant. Why type it in when you can cut and
paste?

------
pxlpshr
Nothing will ever stop a hacker from programming and figuring out a machine,
especially age.

I started when I was a tot during the days of DOS on an IBM box. At least kids
these days have the internet, we were left to fend for ourselves.

------
aaronz3
I remember growing up I was playing on the Internet and found a 10 chapter
book online for QBASIC. I printed it out and had it scattered all over the
floor, and in no time at all I was writing code that actually did things. I
had never written code before and I was in elementary school (9 or 10?).

Eventually this led to html, javascript, php, VB, C#, etc. Dad wasn't real
thrilled when he realized I used all of the printer ink to do this, but I'd
say it was a pretty good return on his investment.

EDIT: I'd like to play with BASIC again, anyone know of a way to do that on
OSX? VM?

~~~
lepht
You should check out Chipmunk BASIC [1]. Nice simple BASIC interpreter that
runs natively in Mac OS X and includes basic graphical functions.

[1]<http://www.nicholson.com/rhn/basic/>

------
lisper
It's important to keep in mind that one of the reasons it was "easier" to
program back in the day is that you had so many fewer options. The flip side
of not _having_ to install anything is not being _able_ to install anything.
BASIC was cool, but once you hit its limits (which was very easy to do) you
were kinda screwed. Sure, you could learn machine language, but that was a
_lot_ harder than running Python or Javascript.

------
alttab
This type of math-programming-graphics-game mind soup resonates with me very
well.

I did mine on a TI-83 calculator, went to visual basic, and then C++/DirectX.
Once I grasped sin/cos/tan, I created Microcosm (missle command, angles,
rotation as my primary game mechanic due to my fascination of the power of
trig, <http://arcade.connersc.com>).

I feel the same way. You put it in words clearly. :)

------
jsz0
I tried a few times to get into programming but the amount of institutional
knowledge required was so off putting. Learning the languages and APIs isn't
too hard but I found all the reference material didn't teach me how to
actually solve problems. I suppose this is something you need a mentor or at
least a strong background in legitimate computer science to understand.

------
shaunxcode
When I was a kid I did not know any adult programmers and thus assumed
programming looked like the strange special characters you would get through
alt + shift combos. This didn't scare me - it just upset me that I didn't know
how to utilize it. If someone had shown me APL I would have been amped hahaah!

------
axod
Javascript is pretty much the new BASIC for kids these days.

    
    
      10 print "BAH"
      20 GOTO 10
    
      <script>
      for(i=0;i<100;i++) {
        document.write("BAH");
      }
      </script>

~~~
asciilifeform
Barring grotesque hacks, Javascript (and the entire standard WWW stack) will
neither emit sound nor write to a disk. Not to mention the inescapable "If
InternetExplorer Then CrappyWorkaround" abominations which come with web
programming.

------
caffeine
I miss _why ...

~~~
camccann
Hackety Hack, like all of _why's projects, got adopted by someone else after
his departure: <http://github.com/steveklabnik/hacketyhack/>

Alas, it doesn't seem to be getting much activity.

~~~
steveklabnik
It's true. A crazy series of events took lots of my time recently... including
the launch of my startup. I'm planning on getting back into the swing of
things with Hackety, though, as my local Ruby Brigade just started up, and I
feel like I could get a decent helping hand from some of those guys. I'd love
to not be the only guy doing something with it. I have one other core
contributer, but again, he's busy as well.

Every project goes through slow periods. _why has some quite large shoes to
fill.

~~~
camccann
Hey, that's awesome, I hope it didn't sound like I was bashing you for
neglecting it or anything. _why seemed to be superhumanly productive, so I
wouldn't expect any one person to keep up his pace. I'm just happy to see that
his projects weren't abandoned, thanks to you and everyone else who took up
the torch.

~~~
steveklabnik
None taken. We actually had a discussion about this a week or two ago. I'm
just glad that you linked to my GitHub. Thanks for still talking about
Hackety.

------
samlittlewood
I have been looking at this for my 7 yr old son. Beyond school, his time is
spent getting muddy on a soccer field, swimming, building dens, and generally
racketing around with friends.

However, along with every other 7 year old, he want to know how things work. I
am finding that many of my explanations get from A to B via "and at this point
there is a computer that does ...". - Things: Microwave, car, alarm clock,
phone, camera etc. and broader systems: exams, shops, banks etc.

I could explain things in terms of the model that is embodied in the computer,
but that seems wrong - at least as the only explanation. If you pull it apart,
you don't find the coresponding physical embodiment.

If he does want to dig further into this and explore how to make computers do
things, I want to have a good set of resources to draw on - My current short
list w/ comments:

\- Lego Mindstorms NXT

Start with the provided graphical environment, move on to one of the several
text based development environments, eg: NQC, leJOS. He loves Lego, and I have
already set up a mindstorms controller+psx joystick to give him a
drive+steering component he can use in his own constructions. I find the
graphical a bit cumbersome.

\- Nodebox (<http://nodebox.net/code/index.php/Home>)

I think it is great - python & easy graphics. I have already been showing off
some simple drawing animations and fielding requests to: "Make it go the other
way, go red, faster, jump etc." - Cool, but I am well aware the he'll get
frustrated with syntax errors.

\- Processing (<http://processing.org/>)

Also, cool - not used it so much myself, and I am not sure I want to start
explaing curly parens & semis, but it does lead into Wiring and Arduino. One
thing I would really love for him to experience is making things w/ embedded
cpus - even if it just simple things to spin motors and flash leds.

\- Scratch (<http://scratch.mit.edu/>)

Only recently found this. For me, the visual programming was way easier than
Lego NXT. Going to have more of a play.

\- Nintendo DS homebrew

\- C64 - in the form of a C64DTV (<http://en.wikipedia.org/wiki/C64_Direct-to-
TV>)

\- Usebox (<http://belogic.com/uzebox/>)

When I was mucking around w/ NDS homebrew I had him draw some characters, then
we scanned them and displayed them as sprites bouncing around (one was under
joypad control - no collisions or gameplay, maybe 20 lines of code)

My own experience was that making games was a very powerful motivation - and
all these 3 provide a way into that - C64 & Uzebox would provide a similar
experence to mine (well, I was a BBC fanboy, but anyway). Nintendo DS would be
a bit more up to date, and would have some currency with his mates. Some way
of targetting NDS from processing would be a cool halfway house.

Assuming he is at all interested, it will be interesting to see if any of this
is appropriate. If not, well, there is another son - and maybe I'll just get
stuck in myself.

------
ilyak
Teach children to draw on a canvas in javascript.

You can easily make a page with a javascript editor and immediate evaluation
if you wish, and simplified api.

~~~
swannodette
Someone should build a social and pedagogical programming environment for kids
on the web. The main problem here is the frustrating fact that one stupid
browser doesn't support an HTML tag that's now 4 1/2 years old.

~~~
michael_dorfman
There are some very nice programming environments for kids. MIT Scratch
(<http://scratch.mit.edu/>) immediately springs to mind, for example.

Any particular reason it needs to be web-based?

~~~
jacquesm
Yes, because every kid (at least in the 'developed' world) nowadays has web
access but not every kid can install software on the machines they are allowed
to use (for instance in school, the library or their parents' machine).

~~~
cakesy
And, they can very easily show it to there friends, if it is in javascript. My
niece loves designing webpages that she shares with her mates. Of course,
getting her to program rather than put up pictures of twilight is another
issue.

~~~
netcan
True. I guess these are the same two reasons anything needs to be web-based:
(1)Easy to get started. No hurdles. (2) Sharing

