Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Teaching kids to program (in Java)

Reply
Thread Tools

Teaching kids to program (in Java)

 
 
Roedy Green
Guest
Posts: n/a
 
      04-13-2012
On Thu, 12 Apr 2012 13:09:39 -0400, David Lamb <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>(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..
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      04-13-2012
On Thu, 12 Apr 2012 20:36:12 -0400, David Lamb <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>
>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..
 
Reply With Quote
 
 
 
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      04-13-2012
Leif Roar Moldskred <(E-Mail Removed)> wrote:

(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
 
Reply With Quote
 
Rui Maciel
Guest
Posts: n/a
 
      04-13-2012
Leif Roar Moldskred wrote:

> 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
 
Reply With Quote
 
Stefan Ram
Guest
Posts: n/a
 
      04-13-2012
Leif Roar Moldskred <(E-Mail Removed)> writes:
>(Why isn't the first element of an array at position 1?


http://www.purl.org/stefan_ram/pub/zero

>What's the difference between int and Integer?


Java does not define a difference of types.

>What _is_ a Null Pointer, anyway?)


A reference r with r==null.

 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      04-13-2012
On Fri, 13 Apr 2012 14:06:28 +0100, Rui Maciel <(E-Mail Removed)>
wrote:

>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
 
Reply With Quote
 
Joshua Cranmer
Guest
Posts: n/a
 
      04-13-2012
On 4/13/2012 9:07 AM, Leif Roar Moldskred wrote:
> 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.

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


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

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
 
Reply With Quote
 
Arved Sandstrom
Guest
Posts: n/a
 
      04-14-2012
On 12-04-12 11:42 AM, Lew wrote:
> Roedy Green wrote:
>> 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.

[ 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 fly was very close to being called a "land," cause that's what they do
half the time.
-- Mitch Hedberg
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      04-14-2012
On 4/13/2012 6:03 AM, Leif Roar Moldskred wrote:
> Arne Vajhøj<(E-Mail Removed)> wrote:
>>
>> 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.

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



 
Reply With Quote
 
Arne Vajhj
Guest
Posts: n/a
 
      04-14-2012
On 4/13/2012 10:27 AM, Leif Roar Moldskred wrote:
> glen herrmannsfeldt<(E-Mail Removed)> wrote:
>> Leif Roar Moldskred<(E-Mail Removed)> wrote:
>>
>> (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?

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

>> How about Fortran or C?

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

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

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Teach your kids to program Lawrence D'Oliveiro NZ Computing 0 01-28-2008 08:05 AM
Looking for a program to run on XP to remotely watch what my kids are doing, something like a keylogger. TIA!! Tory Brown Computer Security 45 06-05-2005 03:44 PM
self teaching WAN ; driving me back out into the garden to plant peas; frustrated . Barrett Bonden Cisco 5 04-07-2005 04:09 AM
Self teaching, cannot lock database file Michael Powell ASP .Net 2 03-29-2005 03:34 PM
Teaching resources VisionSet Java 2 10-07-2004 07:22 AM



Advertisments