Programming for 14 year old (was Programming for 13 year old)

Programming for 14 year old (was Programming for 13 year old)

Post by ggrothendi » Wed, 25 Feb 2004 04:59:43


bout a year ago I posted a question about how to go about teaching
programming to my 13 year old nephew. Well, we have been at it off
and on for about a year averaging sessions of maybe twice a month
and now he is 14 years old.

We started with HTML which worked out well in that it got him
creating code fast. We used the Werbach barebones guide to
HTML ( http://werbach.com/barebones/download.html ) as a reference.

Then we progressed to Javascript which was good in that it was
an easy transition although its going a bit slowly. I found some
reference material on the net but ultimately got the Visibone
javascript reference card ( http://www.visibone.com ) as well as
their HTML reference card as these are inexpensive and compactly
provide the language definitions -- I don't think he would have
the patience for a book.

We then proceeded to try out R ( http://www.r-project.org ) so he
could try out scientific programming. R is interactive -- type in
a command and immediately get the answer back -- but it did not
seem to hold his interest and I returned to Javascript with him.

We will probably continue to spend some more time on Javascript
until he gains more proficiency though I have been thinking of
trying out gamemaker too -- its a programmable game making environment
( http://www.cs.uu.nl/people/markov/gmaker/ ) as he is about to
get a PC so we soon won't be restricted to Mac environments.

I think what I need now are some good motivating problems to work on.
Anyone have any ideas for problems?

---

A year ago I wrote on this group:

I want to teach programming to my 13 year old nephew who has a Mac G3
OS9.1 .

My original plan was to start with HTML (we created our first web page
last week), move to Javascript since its a simple transition to just
start adding some Javascript commands into HTML.

I was then going to move to Java. Java looks like Javascript and
provides a good upward migration path. Someone on the java newsgroup
had the idea of teaching Java applets first which would make the
transition particularly easy. There is also a free IDE called BlueJ
targeted at education. Unfortunately it seems that the latest Java is
not supported on OS9.1 nor is BlueJ. Thus I am back to reconsidering
how we progress.

I did some searching on the net and found that Java, Smalltalk/Squeak
and Scheme/Lisp were often used to teach programming in first year
programming courses.

Ideally, I was hoping to teach something that:
- is mainstream
- runs on a Mac G3 with OS9.1
- does not involve $$$
- is cross platform so he can move to Windows or Unix/Linux if he gets
a different computer in the future
- provides a high motivation level, i.e. you can get some results
fast. This point is really important. The entire exercise requires
maintaining his interest level.
- forms a logical upward migration path from HTML and Javascript

Here are some of my thoughts -- hopefully this will not start a debate
on programming languages -- I am just trying to figure out what should
be my game plan here.

- Realbasic. Pro: rapid development, close enough to VB to be
considered mainstream. Con: new syntax, costs money. (Someone on Mac
group mentioned this one to me.)

- Lua, Python, Ruby, Squeak/Smalltalk. Pro: rapid development? free.
Con: new syntax, arguably not mainstream. (Someone on the Java group
mentioned to me that there is some introductory programming mater
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Brian Web » Wed, 25 Feb 2004 05:19:07

"Grod" wrote...

Look into DarkBasic. It's a BASIC variant that can be used
to create 3D video games, among other things. My nephew
wants to learn programming too, specifically so he can make
video games. I haven't gotten around to shelling out the
money for the full version (w/ demo game source) yet, or I'd
tell you more.

- Brian

 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by wolf » Wed, 25 Feb 2004 11:00:37

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Grod scribbled these words at Monday 23 February 2004 14:59:


If you want to teach your nephew programming, then try a language such as
Pascal, Modula-2 or even SmallTalk. There are free compilers and
interpreters available. HTML is not a prgramming language, by the way; it
is a mark-up language.

<deletia>

- --
Free Software Foundation (FSF) Associate Member 499
Registered Linux User 277671
SUSE Linux (Linux kernel 2.4.23) Elite-4 Zero-Footprint PC

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAOrBMnV55yPPu6X0RAqY8AJsE4an6DbQrMs/oI7xtvEMq1m3d+gCgjWXn
ckXmPk6PZUb+70DGVzCyBag=
=t/3V
-----END PGP SIGNATURE-----
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Buste » Wed, 25 Feb 2004 13:24:25

"Grod" < XXXX@XXXXX.COM > wrote

on.

There's these creatures, right, they're called evaders. They have
two eyes, a tail, two fins and a brain. There are also predators.

The tail length is proportional to the forward thrust the fish
(sorry, evader) has available. The fins correspond to angular
thrust, clockwise and anticlockwise. The tail and fin lengths can be
generated at random, at first.

The eyes each start out at a random angle around the head. If a
predator is in a segment centred on one of the fish's eyes, that is,
within a certain radius of the centre of the head and at an angle
within 15 degrees or so of the current angle of the eye, we say the
evader can see the predator with that eye. The trigonometry isn't
too hard. You can give the fish a proper eye examination when the
graphics are working.

Play around with the brain. A brain like in this picture need only
take up 224 bits of memory, all initially random. (I've never tried
this one out. The one I've used has 8 inputs to 6 neurons all 6 of
which, including the 3 motor neurons, feed back as inputs for the
next frame. Thats's harder to draw.)

+-------+
| Eye 0 |
+-------+
| +-------+
| | Eye 1 |
| +-------+
| | +-----------------------+
v v | +------------------+ |
| | | | +-------------+ | |
| | | | | | | |
IN | | | | | | | |
+------------------------+ | | |
| 0 1 2 3 4 | | | |
| | | | |
| This brain has 7 | | | |
| neurons. Each one | ^ ^ ^ feed back signals
| fires or doesn't fire | ^ ^ ^ from the previous
| according to the | | | | step
| 32 possible inputs. | | | |
| | | | |
| 0 1 2 4 5 6 | | | |
+------------------------+ | | |
OUT | | | | | | | | |
| | | | | +----------+ | |
| | | | +---------------+ |
| | | +--------------------+
| | |
| | +------+
| | | Tail |
| | +------+
| +-------+
| | Fin 1 |
| +-------+
+-------+
| Fin 0 |
+-------+

Each predator just goes for its nearest evader: if they get close
enough together the evader is destroyed. The predators have position
and velocity. For each frame, increment the velocity slightly in the
direction of the nearest evader, multiply the velocity by a friction
factor, and add the velocity to the position. The scale of these
things can take some getting used to. Velocity is in pixels per
frame. The predators are V-shaped and point in the direction in
which they are moving (the direction of their velocity) unless they
are stationary.

The evader fish are more complicated because they also have to keep
track of their angle and angular speed. The angular acceleration
depends on which fins are active and their lengths. The linear
acceleration depends on the tail. There are two kinds of friction to
think of. The fish are pretty easy to draw. They look like this,
only with eyes. |------O O---|

Map the screen onto a torus (like Pacman), or if you prefer, a
moebius strip or a projective plane. This complicates the
nearest-evader algorithm.

 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by TLOlczy » Wed, 25 Feb 2004 16:40:31

On 23 Feb 2004 11:59:43 -0800, XXXX@XXXXX.COM (Grod)



I don't remember the original post or replies to it but I noticed
something in the present replies. They don't ask why you want
your son to know how to program.

This is a very important question as there are many paths your
son may go. For example, he may want to become a System
Administrator. In which case bash, perl, python and ruby
are the way to go. OTOH he may want to become a programmer.
In which case the way to go is m,ore complex.

If he needs to do GUI stuff, I would have him learn ( eventually )
WxWindows and OpenGL. I preffer WxWindows to other GUIs
because windows and unix versions tend to be close. So I can
write stuff that runs on both.You could have, for example, GTK
instead, but the versions on Windows tend to lag the Unix versions.

Squeak is nice, but it seems very slow to me.

I like Lisp, Scheme, OCaml , SML, Haskell families, for a particular
reason, In emacs you can edit a file in one of these languages and as
you edit send over the parts to an interpreter to see how well it
works. When done you can then compile the file.

I would stay away from Lisp, because I expect that your son wants
to have executables of things he wrote. To do that you will have
to shell out big bucks.

Scheme is OK and PLT Scheme would be nice, but frankly
I would go with OCaml. It's seems simpler but also very pwerful.




The reply-to email address is XXXX@XXXXX.COM .
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,

**
Thaddeus L. Olczyk, PhD

There is a difference between
*thinking* you know something,
and *knowing* you know something.
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by gswor » Wed, 25 Feb 2004 17:54:46


I have the 2D Blitz Basic, which is similar, and used that for some
fun things in leisure time. It was very simple to start out, had the
potential to create some quite complex games too and the resultant
.exe was fast enough (and now, when 1Ghz is considered slow,
everything would seem fast!).

The only drawbacks as a teaching aid are the many ways in which one
can forego solid program structure. It is a BASIC style language
(with a hint of C), with all the freedom and bad habits you can learn!

When kids take on game programming, whatever the tool, they're taking
on 2D (or more complex 3D) math to some extent, and getting involved
in fairly platform specific things and I can see that backfiring, as
many fairly important skills in programming won't be employed much in
the kinds of game that tend to be produced (e.g. file io, text
processing etc)
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Michael Me » Wed, 25 Feb 2004 20:40:02

gswork schrieb:

Well, one can program BASIC in any language!
Blitz certainly has the features to teach good structure; my students
haven't used GOTO in their programs yet.

However, I think Blitz2D has dreadful error reporting, it doesn't even
give you line numbers. It also requires IE to be installed.

If you know your way around programming, then, yes, you get some stuff
moving quickly, what with its plethora of game-related commands.

mendel
--
Feel the stare of my burning hamster and stop smoking!
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Michael Me » Wed, 25 Feb 2004 20:44:55

wolf schrieb:

I thought the idea of using HTML as a pre-programming language
excellent; it teaches you to think in blocks, you can practice looking
up documentation and using parameters; you get visible results even if
you still have some errors (with typical compilers, your code can't be
"almost right" - it's either GO or NO GO, which is frustrating), and
with the W3 validator you get a strict syntax check which you can aim to
get to 0 errors.

Moving from writing correct HTML to writing correct program code only
entails learning about algorithms; you've got the formal structure
already learned at this point.

mendel
--
Feel the stare of my burning hamster and stop smoking!
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by ggrothendi » Wed, 25 Feb 2004 22:39:15


He seems to like math and science and everything involves computers these
days so I thought it would be useful for him to have a general knowledge of
programming.

My idea was to try a variety of approaches: HTML for web pages,
Javascript for programming concepts and R for scientific programming
so he can choose which, if any, he wishes to focus on. At this point
we are focused on Javascript and I probably will stick with that
until he achieves a greater proficiency.

As one of the posters a year ago mentioned, the real problem is holding
the interest of someone that age. Thus the thrust of my question was
not which language to use but what are some interesting problems. They
should be amenable to a Javascript solution and need to be simple enough
for a beginner yet interesting enough to be motivating.
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by alfp » Wed, 25 Feb 2004 22:53:45

* XXXX@XXXXX.COM (Grod) schriebt:



My best advice is to stop pressing your son, to back off a little. I know,
you absolutely don't feel like you're doing anything but being supportive. But
it seems that you are in a sense *** him, without quite being aware of it.

At that age I would have been ecstatic if I had the opportunity your son has.
As it were I had to make do with old relays and transformers and triodes and
such salvaged from old radio equipment. Some transistors too.

But if my father or anyone else had tried to steer me into it I'd have lost
interest very fast, very very fast; an interest like that is something personal,
something owned, and by forcing it one is stealing a part of the other person.

Be a resource, be supportive, never give false praise, be critical & honest,
in short be reliable.

But don't be a teacher with an agenda.
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Michael Me » Wed, 25 Feb 2004 23:41:50

Grod schrieb:


Try a collection of the "Computer recreations" columns from Scientific
American; these are stimulating problems presented in an accessible way,
and they often lend themselves to some programming.

A quick web search revealed this:
------------------
A.K. Dewdney wrote for some years the monthly column "Computer
Recreations" in Scientific American. The following three books are the
collections of these columns.
Armchair Universe: An Exploration of Computer Worlds
The Magic Machine: A Handbook of Computer Sorcery
The Tinkertoy Computer and Other MacHinations

The books discuss today's hottes and most fascinating topics of
programming and computer science, including chaos, fractals, computer
viruses and much more. Easy programming examples let you try many ideas
on your home computer, from entertaining brain teasers to scientific
applications.
-----------------

mendel
--
Feel the stare of my burning hamster and stop smoking!
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Programmer » Thu, 26 Feb 2004 01:21:18


What an outstanding and worth-remembering point!

--
|_ CJSonnack < XXXX@XXXXX.COM > _____________| How's my programming? |
|_ http://www.yqcomputer.com/ | Call: 1-800-DEV-NULL |
|_____________________________________________|_______________________|
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Michael Me » Thu, 26 Feb 2004 03:07:39

Programmer Dude schrieb:


Well, thank you!
Keep in mind it was Grod's idea in the first place. :)

mendel
--
Feel the stare of my burning hamster and stop smoking!
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by cmad_ » Thu, 26 Feb 2004 05:09:49

I don't know if I'm right but I don't consider site building pure
programming. It may be but I don't think it should be (if it is).

You could teach him Pascal, it's really easy. Then if he likes it and
wants to move on to graphical apps he can switch to Delphi (for Win32)
or Kylix (for Linux).

After Pascal, just show him a bit of the languages you think he'd like
and let him choose his own path. I chose C++ :) But I think I'll try
to start a bit of Java too.
 
 
 

Programming for 14 year old (was Programming for 13 year old)

Post by Pedro Grac » Thu, 26 Feb 2004 07:40:01


Solving puzzles, playing games, ...

For example:
+ solve "what's the number for which the sum of all integers between 1
and itself (including itself) has 4 *different* digits?"
+ solve "what's the ten-digit number for which the first digit
represents the number of 0's in the number; the second digit
represents the number of 1's; ... the last digit represents the number
of 9's?"

+ make a script that chooses a random number (within certain limits) and
tells you whether your choice is too low or too high and repeat until
you find the number
+ make the script find the number

+ play tic-tac-toe
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--