Teaching kids to program (in Java)

M

Mark

Hi,

Does anyone know any good resources to teach Java programming to kids.
I know the theory but I don't know how to make it interesting for
children. When they realize they won't be writing the next FPS game
within the first half hour they often lose motivation ;-)
 
G

glen herrmannsfeldt

Mark said:
Does anyone know any good resources to teach Java programming to kids.
I know the theory but I don't know how to make it interesting for
children. When they realize they won't be writing the next FPS game
within the first half hour they often lose motivation ;-)

I don't know if it helps or not, but you might look at:

http://webster.cs.washington.edu:8080/practiceit/

-- glen
 
R

Roedy Green

Does anyone know any good resources to teach Java programming to kids.
I know the theory but I don't know how to make it interesting for
children. When they realize they won't be writing the next FPS game
within the first half hour they often lose motivation ;-)

I taught computer summer camp circa 1983 with spectacular results vis
a vis motivation. I am sure I wrote an essay on my techniques, but I
cannot find it.

After interviewing each camper, I discovered they nearly all wanted to
write video games. Astoundingly the 7 to 15 year olds wrote primitive
ones in a week.

I promised them I would not tell them anything that was not needed to
write video games. They would have to trust me.

I never demanded their attention for more than 15 seconds at a time.

I presented everything as a puzzle to be solved, rather than methods
to be memorised. They were NOT supposed to understand. I just gave
hints. They have to figure it out. For example the opening exercise
was to figure out what each of the keys on the keyboard did. They
figured it all out far faster than I could have explained it to them,
and without the tedium.

I leaked information to advanced students. Other students seeing the
benefits of this knowledge would chase me around demanding to be
taught too. Some professional teachers went bug-eyed seeing some ten
year olds DEMANDING to be taught trigonometry.

Pandemonium is normal and should not be discouraged. I relaxed every
normal rule of school I possibly could, including demanding respect.

There were handouts in the form of simple program listings students
could, key, understand and then do theme and variation. They never saw
anything put properly commented structured code, and so it never
occurred to them to write anything else. Visual elements, especially
reusable visual element lead naturally to logical structure.

The idea to start the student did almost nothing, but got a huge
payoff, e.g. a giant flying helicopter. Over time to get more subtle
control they had to master more and more. None of this boring learning
to do arithmetic. That was left to the very end when they were
motivated to demand it. Lots of use of canned random number generation
to clone and randomly position.

I had a dream team of tutors who worked with the kids. Mostly what
they had to do was keep kids who were falling behind the others from
freaking out. The kids expected so much of themselves.

The kids were insanely motivated, pouring over listing every waking
moment.

I had some "experienced" older kids who were resistant to learning
anything. I just let them go. It was so fun when the little kids
quickly surpassed them and their spaghetti methods.

I poured a jug of orange juice over one brat's head. I was legendary
ever after ever though the backers were terrified the kid's parents
would sue.

We had spectacular food. Even the kids commented how good it was.
--
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..
 
D

David Lamb

I presented everything as a puzzle to be solved, rather than methods
to be memorised. They were NOT supposed to understand. I just gave
hints. They have to figure it out. For example the opening exercise
was to figure out what each of the keys on the keyboard did. They
figured it all out far faster than I could have explained it to them,
and without the tedium.

BTW, this is now standard educational theory even for university
students; our Centre for Teaching and Learning is big on problem-centred
learning, among many other ways of engaging students. The trouble for
the OP is that Roedy doesn't have a textbook to point you at, nor do I.

Since he's a freelance, I suppose you could hire him! :)
 
L

Lew

Roedy said:
I taught computer summer camp circa 1983 with spectacular results vis
a vis motivation. I am sure I wrote an essay on my techniques, but I
cannot find it.

After interviewing each camper, I discovered they nearly all wanted to
write video games. Astoundingly the 7 to 15 year olds wrote primitive
ones in a week.

I promised them I would not tell them anything that was not needed to
write video games. They would have to trust me.

I never demanded their attention for more than 15 seconds at a time.

I presented everything as a puzzle to be solved, rather than methods
to be memorised. They were NOT supposed to understand. I just gave
hints. They have to figure it out. For example the opening exercise
was to figure out what each of the keys on the keyboard did. They
figured it all out far faster than I could have explained it to them,
and without the tedium.

I leaked information to advanced students. Other students seeing the
benefits of this knowledge would chase me around demanding to be
taught too. Some professional teachers went bug-eyed seeing some ten
year olds DEMANDING to be taught trigonometry.

Pandemonium is normal and should not be discouraged. I relaxed every
normal rule of school I possibly could, including demanding respect.

There were handouts in the form of simple program listings students
could, key, understand and then do theme and variation. They never saw
anything put properly commented structured code, and so it never
occurred to them to write anything else. Visual elements, especially
reusable visual element lead naturally to logical structure.

The idea to start the student did almost nothing, but got a huge
payoff, e.g. a giant flying helicopter. Over time to get more subtle
control they had to master more and more. None of this boring learning
to do arithmetic. That was left to the very end when they were
motivated to demand it. Lots of use of canned random number generation
to clone and randomly position.

I had a dream team of tutors who worked with the kids. Mostly what
they had to do was keep kids who were falling behind the others from
freaking out. The kids expected so much of themselves.

The kids were insanely motivated, pouring over listing every waking
moment.

I had some "experienced" older kids who were resistant to learning
anything. I just let them go. It was so fun when the little kids
quickly surpassed them and their spaghetti methods.

I poured a jug of orange juice over one brat's head. I was legendary
ever after ever though the backers were terrified the kid's parents
would sue.

We had spectacular food. Even the kids commented how good it was.

Don't worry about finding that essay; this one is fine. I am so in awe of your
methods then, and courage to use them, that words fail me. Bravo.
 
A

Arne Vajhøj

I passed this question along to our intro programming profs and they
uniformly said don't use Java. Recommendations included

(a) Logo (presumably with turtle graphics)
(b) Python. One example: http://coweb.cc.gatech.edu/mediaComp-plan/27
(c) The Alice environment (Alice.org)

I would say that it depends a bit on the age of the kids.

If they are old enough to learn serious math in school, then
they are old enough to learn Java.

Arne
 
D

David Lamb

I would say that it depends a bit on the age of the kids.

If they are old enough to learn serious math in school, then
they are old enough to learn Java.

Hmm. I suspect "old enough for serious math" might be a tad older in
North America than in Dennmark.
 
R

Roedy Green

Don't worry about finding that essay; this one is fine. I am so in awe of your
methods then, and courage to use them, that words fail me. Bravo.

Kids ten years later would come up to me and tell me that week at
summer camp had encouraged them to take up programming as a living.

I started from a different premise. I was not teaching kids, I was
trying to find a way to make them have a wonderful time involving
computers. He had paid primarily to have fun.

The problem is this style of teaching is utterly exhausting. I was
burned out by the fourth week group.

But from an efficiency point of view using student time, I have never
seen anything like it. I had my exercises planned for the first
group, but they had vacuumed them up in the first two days. Every
night my team worked to prepare something to try to stay ahead of
them.

The big problem now is we bore students to death. Only a few of them
are resilient enough to retain curiosity.

We try to force students to learn things without convincing them first
there is any practical use for the knowledge. This is really dumb.
It is not just any practical use, but something THEY care about.

I remember in grade 1 being motivated to read by a picture of a pet
rabbit. I was convinced that once I learned to read, I would find out
something terribly interesting about the rabbit. I was betrayed. All
it said was something like Look look, see see.

This is why I recommend Java students select a student project. It
gives them emotional motivation to learn whatever they need to
complete the project, rather than just learning syntax is isolation.

--
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..
 
R

Roedy Green

(a) Logo (presumably with turtle graphics)

It is very important to be able to get a splashy result with a minimum
of keystrokes or understanding to start. In Forth you can have a
HELICOPTERS verb that draws N helicopters at random locations and
colours. You need to temporarily be able to hide the messy details.

Totaling up a column of figures is a lot of work for very little
emotional reward.
--
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..
 
R

Roedy Green

Hmm. I suspect "old enough for serious math" might be a tad older in
North America than in Dennmark.

The "trigonometry" the kids wanted me to teach them was a set routines
that could plot trig functions. They could experiment to see the
effects of amplitude, period and phase to simulate ocean waves.

I suspect though when these kids finally did get to learning trig,
they would approach it more eagerly than had they not been exposed to
my "leaking".

Another trick I would use is leaking to a discouraged student. He/she
would embed the trick is his creation. Other kids would see it and
demand to know how it was done. He could lord it over them.
One poor kid known as "Rockfish" was the recipient of the trig
plotting methods."

At one point I explained to "Rockfish" that such fish were extremely
tough. They could live out of water for long periods of time, and were
just about impossible to kill by bonking them. So it was not that
dishonourable an epithet. That seemed to do the trick.

Dealing with discouraged kids was a major part of what we did.
They are so competitive and so tough on themselves. It was made worse
by the direct competition of 7 year olds with 15 year olds.

--
Roedy Green Canadian Mind Products
http://mindprod.com
When you were a child, if you did your own experiment
to see if it was better to put to cocoa into your cup first
or the hot milk first, then you likely have the programmer gene..
 
G

glen herrmannsfeldt

(snip)
In my not particularly humble opinion, Java is too crufty to make for
a good _introductory_ language. There are too many old sins and too
many idiosyncrasies in the language that are likely to confuse or
stump someone who doesn't already know how to program.

Compared to what? How about Fortran or C?
(Why isn't the first element of an array at position 1? What's the
difference between int and Integer? Why doesn't System.out.println(
"Value: " + 01234 ) work? Why do I get a NullPointerException on the
line "System.out.println( factorial( inputValue ) );"? What _is_ a
Null Pointer, anyway?)

Many languages have parts that make them hard to use, and hard
to learn, but we do it anyway.

-- glen
 
R

Rui Maciel

Leif said:
In my not particularly humble opinion, Java is too crufty to make for
a good introductory language. There are too many old sins and too
many idiosyncrasies in the language that are likely to confuse or
stump someone who doesn't already know how to program.

(Why isn't the first element of an array at position 1?

The term "array" refers to a collection of objects which were allocated in a
continuous memory segment. A reference to an array points to the first
object of the array. The array index represents the offset with regards to
the first element. So, index 0 means a zero offset from the first object of
the array (i.e., address of first object in the array), index 1 refers to
the object which is 1 object size after the first object (address of first
object + 1 object size), array 2 is two objects, and so on.

This isn't an "old sin" or an idiosyncrasy. It's exactly what the
programmer intends to do. If the programmer isn't aware of that then it
isn't a shortcoming of the programmer language; it reflects a lack of
understanding regarding what he is doing and what he is trying to do. And
this does not mean that the language doesn't make for a good introductory
language.

What's the difference between int and Integer?

The former is a primitive, while the latter is a reference to an object of
type Integer. This is covered in any introductory tutorial.

Why doesn't System.out.println(
"Value: " + 01234 ) work?

Why do you believe it doesn't work? You've used an octal integer literal to
express the value of an integer number. You get exactly what you asked for.

Why do I get a NullPointerException on the
line "System.out.println( factorial( inputValue ) );"?

You have to be a bit clearer with that, as you haven't defined inputValue or
factorial().

What is a Null Pointer, anyway?)

I don't believe it is reasonable to accuse any programming language of being
"too crufty to make for a good introductory language" if the only problem
which has been pointed out boils down to ignorance regarding how to use that
programming language. No programming language, no matter how appropriate it
might be as an introductory language, enables you to write any code without
first learning how to do it.


Rui Maciel
 
G

Gene Wirchenko

Leif Roar Moldskred wrote:
[snip]
Why doesn't System.out.println(
"Value: " + 01234 ) work?

Why do you believe it doesn't work? You've used an octal integer literal to
express the value of an integer number. You get exactly what you asked for.

No, he got exactly what the language spec says he should get.

It is not obvious to anyone who has not run across it before what
is happening in this case. Leading zeroes are used in the RW, and
never mean octal (that I have ever seen).

[snip]

Sincerely,

Gene Wirchenko
 
J

Joshua Cranmer

You'll never see a mathematican refer to the 0th element of an array
or vector. Zero-based arrays most certainly are an idiosyncrasy of
programming languages -- which sometimes, such as for C, makes
sense. For a programming language that does arrays right, look to Ada.

I see lots of references to things like x_0 in mathematics. It really
comes down to "is 0 the first natural number or is 1 the first natural
number?" Edgar Dijkstra (I believe) once laid out his opinion of array
indexing and arrived at the conclusion that 0 <= i < n is the most
natural way to do for-loop-iteration, so array indexing should start at
0 and not 1. The argumentation, IIRC, boils down roughly as follows:
1. [start, start + length) is the most natural bound
2. Length should be a simple expression, i.e., n
3. Using (<=, <) as your pair of comparison most clearly indicates the
use of [a, b) notation
4. Thus, start <= i < start + n is the appropriate notation.
5. When the start is the beginning of the array, start + n should just be n
6. So start should be 0, and we get 0 <= i < n

There are occasionally places where 1-based indexing makes more sense
(array-based heap notations are a particularly well-known example), but
I'm not sure that giving programmers the ability to choose array bounds
is the best option.

Also, FWIW, the convention of 1 being the "first" number isn't totally
universal: the Mayans started from 0. And they were arguably the best
mathematicians of their time.

So we should start by teaching everyone APL, right? :)

The problem is that discussing a basic Hello World in Java requires, at
a minimum, handwaving the public class HelloWorld, the public static
void main, System.out.println, and the entire compilation procedure. If
you don't handwave, you have to give a lengthy amount of time to
explaining how object-oriented programming works before you can begin
discussing programming. You also very quickly get to bugaboos with
explicit typing, doing I/O (reading from stdin is surprisingly
complicated in Java), collections (generics is complicated enough for
seasoned programmers; for those just starting a few weeks ago, it's an
imposing cliff).
 
A

Arved Sandstrom

[ SNIP ]
Don't worry about finding that essay; this one is fine. I am so in awe
of your methods then, and courage to use them, that words fail me. Bravo.
I agree. The hell of it is, that's how I solve a lot of problems as a
professional developer: the client presents a problem and describes a
desired outcome, and I figure out how to best do it. I'd say that's how
most developers work.

So why not teach programming the same way?

AHS
 
A

Arne Vajhøj

In my not particularly humble opinion, Java is too crufty to make for
a good _introductory_ language. There are too many old sins and too
many idiosyncrasies in the language that are likely to confuse or
stump someone who doesn't already know how to program.

(Why isn't the first element of an array at position 1? What's the
difference between int and Integer? Why doesn't System.out.println(
"Value: " + 01234 ) work? Why do I get a NullPointerException on the
line "System.out.println( factorial( inputValue ) );"? What _is_ a
Null Pointer, anyway?)

I don't think that is different from so many other things kids
learn in school.

When you do math there are certain rules and conventions.

Natural languages has certain rules and conventions.

Arne
 
A

Arne Vajhøj

Compared to languages with cleaner designs and to languages
specifically targeted at teaching programming. I'd easily choose
Pascal or (a subset of) Ada over Java for this purpose, and probably
even Lisp or Smalltalk.

Pascal is a pretty good language for learning to program.

It should be a very small subset of Ada to be good. Ada is way
more complex than Java.
It's been too long since I worked with Fortran and I don't know
anything about the modern Fortrans, so I can't say. Possibly for
students who already works with matrices in math, but I suspect that
for those cases Matlab (or something similar) would be a better match.

I think the core language of C is small enough that it might work
well, as long as the course is targetting low-level hardware (such as
an Arduino board) rather than desktop I/O.

C is rather simple.

But explaining what is going on with incorrect programs
is not so fun.
Sure, but that's not the point. I have nothing against Java as a
general programming language. It's just not a particularly good
language to use to teach someone basic programming. It's both too big
and has too many quirks and kinks to make for a good introduction.

Medium size language with huge standard library.

I would say less quirks than most languages.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top