Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13520

Re: Teaching kids to program (in Java)

Path csiph.com!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!217.73.144.45.MISMATCH!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Fri, 13 Apr 2012 09:07:22 -0500
From Leif Roar Moldskred <leifm@dimnakorr.com>
Subject Re: Teaching kids to program (in Java)
Newsgroups comp.lang.java.programmer
References <pg3do753evmvoql7l2anvnt49qarggqeg6@4ax.com> <jm7290$53c$1@dont-email.me> <4f87624e$0$287$14726298@news.sunsite.dk> <UpydndS--INlZBrSnZ2dnUVZ8jadnZ2d@giganews.com> <jm98ch$3ad$1@speranza.aioe.org>
User-Agent tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (Linux/3.0.0-17-generic-pae (i686))
Message-ID <b_SdnRCLp-2HrhXSnZ2dnUVZ8k6dnZ2d@giganews.com> (permalink)
Date Fri, 13 Apr 2012 09:07:22 -0500
Lines 69
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-Dik8a18R8Mj7C/CRehqJGsA0V5jdzBWDRrXAdROkEByPBzaDa5R34gVF0UTbdxFa2GmGIN6Ly1eC9Jo!UGDhpCZtI4Tx6JM8oi6xjH3Cf+mPyBfzQa1WHRIDhysV9MuvUStBJqrYr3by88lFpLlrLFbaDXY=
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 4521
Xref csiph.com comp.lang.java.programmer:13520

Show key headers only | View raw


Rui Maciel <rui.maciel@gmail.com> wrote:
> Leif Roar Moldskred wrote:
> 
> 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.  

That is true for C. Neither is true for Java. Zero-based arrrays makes
sense in C, where array access just pointer arithmics by another
name. It makes no sense at all in Java, and Java only does it this way
because it was unthinkingly copied over from C along with the syntax.

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

Of course it is -- any Java programmer needs to know this difference
to a t. But it's needless confusion when trying to teach introductory
_programming_ as opposed to introductory Java. You're trying to get
people to understand the concepts of a variable and a type; you don't
need to complicate it with implementation details and corner cases.

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

Again, the context is trying to teach programming to beginners. You
really don't want to take a ten minute break to explain what an octal
number is, why and when someone would use them and why someone was
stupid enough to use leading zeroes as a mark for them in Java.

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

There's only one situation where a NullPointerException would occur on
that line, and to someone who doesn't already understand what's going
on it's going to be intensly frustrating and confusing.

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

Actually, that's exactly what good introductory language should let
you do, as far as possible. You shouldn't have to learn _everything_
about the language before you're able to do _something_ in it. Of
course, Java isn't at the point where you have to learn and understand
_everything_ before you can program in it, but it's further along
towards "evertyhing" than other languagues.

In an ideal introductory language, the things you don't know (yet)
shouldn't get in the way of you applying what you've already
learnt. Java has too many corners you can trip over if you don't know
they are there, for it to be a good example of such a language.

-- 
Leif Roar Moldskred

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Teaching kids to program (in Java) Mark <i@dontgetlotsofspamanymore.invalid> - 2012-04-12 09:12 +0100
  Re: Teaching kids to program (in Java) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-04-12 08:28 +0000
  Re: Teaching kids to program (in Java) Roedy Green <see_website@mindprod.com.invalid> - 2012-04-12 04:36 -0700
    Re: Teaching kids to program (in Java) David Lamb <dalamb@cs.queensu.ca> - 2012-04-12 09:47 -0400
    Re: Teaching kids to program (in Java) Lew <noone@lewscanon.com> - 2012-04-12 07:42 -0700
      Re: Teaching kids to program (in Java) Roedy Green <see_website@mindprod.com.invalid> - 2012-04-12 19:41 -0700
      Re: Teaching kids to program (in Java) Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-13 21:22 -0300
    Re: Teaching kids to program (in Java) Mark <i@dontgetlotsofspamanymore.invalid> - 2012-04-16 13:53 +0100
  Re: Teaching kids to program (in Java) David Lamb <dalamb@cs.queensu.ca> - 2012-04-12 13:09 -0400
    Re: Teaching kids to program (in Java) David Lamb <dalamb@cs.queensu.ca> - 2012-04-12 13:28 -0400
    Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-04-12 19:16 -0400
      Re: Teaching kids to program (in Java) David Lamb <dalamb@cs.queensu.ca> - 2012-04-12 20:36 -0400
        Re: Teaching kids to program (in Java) Roedy Green <see_website@mindprod.com.invalid> - 2012-04-12 19:55 -0700
      Re: Teaching kids to program (in Java) Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-04-13 05:03 -0500
        Re: Teaching kids to program (in Java) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-04-13 10:14 +0000
          Re: Teaching kids to program (in Java) Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-04-13 09:27 -0500
            Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-04-13 20:42 -0400
              Re: Teaching kids to program (in Java) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-04-14 02:08 +0000
                Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-05 20:13 -0400
                Re: Teaching kids to program (in Java) Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-06 12:06 +0000
                Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-06 11:38 -0400
        Re: Teaching kids to program (in Java) Rui Maciel <rui.maciel@gmail.com> - 2012-04-13 14:06 +0100
          Re: Teaching kids to program (in Java) Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-04-13 09:07 -0500
            Re: Teaching kids to program (in Java) Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-04-13 09:53 -0500
            Re: Teaching kids to program (in Java) Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-04-13 10:55 -0500
          Re: Teaching kids to program (in Java) Gene Wirchenko <genew@ocis.net> - 2012-04-13 08:39 -0700
            Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-04-13 20:47 -0400
              Re: Teaching kids to program (in Java) Gene Wirchenko <genew@ocis.net> - 2012-04-15 20:05 -0700
                Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-04-17 22:11 -0400
                Re: Teaching kids to program (in Java) Gene Wirchenko <genew@ocis.net> - 2012-04-17 19:57 -0700
                Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-04-18 19:20 -0400
                Re: Teaching kids to program (in Java) Gene Wirchenko <genew@ocis.net> - 2012-04-18 18:03 -0700
                Re: Teaching kids to program (in Java) Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-19 20:15 -0300
                Re: Teaching kids to program (in Java) Gene Wirchenko <genew@ocis.net> - 2012-04-19 20:08 -0700
                Re: Teaching kids to program (in Java) Lew <lewbloch@gmail.com> - 2012-04-20 12:43 -0700
                Re: Teaching kids to program (in Java) Patricia Shanahan <pats@acm.org> - 2012-04-20 12:58 -0700
                Re: Teaching kids to program (in Java) Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-04-20 15:20 -0500
                Re: Teaching kids to program (in Java) Gene Wirchenko <genew@ocis.net> - 2012-04-20 13:30 -0700
                Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-05 20:23 -0400
                Re: Teaching kids to program (in Java) Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-06 12:22 +0000
                Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-06 11:36 -0400
                Re: Teaching kids to program (in Java) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-05-06 17:10 +0000
                Re: Teaching kids to program (in Java) Gene Wirchenko <genew@ocis.net> - 2012-05-07 09:43 -0700
                Re: Teaching kids to program (in Java) Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-07 18:17 +0000
                Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-05-05 20:18 -0400
          Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-04-13 20:44 -0400
        Re: Teaching kids to program (in Java) Arne Vajhøj <arne@vajhoej.dk> - 2012-04-13 20:38 -0400
        Re: Teaching kids to program (in Java) Gunter Herrmann <notformail0106@earthlink.net> - 2012-04-16 15:32 -0400
    Re: Teaching kids to program (in Java) Roedy Green <see_website@mindprod.com.invalid> - 2012-04-12 19:44 -0700
  Re: Teaching kids to program (in Java) Patricia Shanahan <pats@acm.org> - 2012-04-13 17:59 -0700

csiph-web