Fred Stluka on 26 Mar 2007 21:09:26 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Educational Languages


Douglas,

Douglas Purdy wrote:

Matthew, Fred,


You state/agree that,
"Teaching beginners PHP (& Perl) is a crime"

I don't disagree but I am interested in why you say that.
Could either of you, or anyone else, briefly explain further ?


I think the biggest reason is that scripting languages like PHP and Perl
allow the user to oversimplify things and get by without even a basic
understanding of what is going on.  Sometimes this works fine, and does
exactly what the programmer intended, though often for completely
different reasons than he thought.  Other times, it works fine, but runs
really slowly because he has no idea how much unnecessary work he is
asking the computer to do.  Other times, it runs fine but does something
completely unexpected, and he has no idea why.  The student can come away
with a very low expectation of computers -- that they are mysterious,
somewhat magical things that behave erratically.  I think it is better to
start a new student with a simple basic understanding that encourages
them to expect computers to behave very predictably and repeatably.

When I teach a new student, I start by drawing a picture of a box with
a value inside and a name outside.  That is a variable.  You can put a
value in, and go back later to get it, change it, and replace the old
value with a new value.  You can't have 2 values in the box at the same
time.  An array is a similar row of boxes.  Each box has a type.  You
can't put a letter in a number box.  You can't put a value in a box that
doesn't exist.  etc.  Logical, predictable, understandable, repeatable.

I think this is better than teaching that variables will come into
existence on the fly as soon as they are mentioned, so be careful to not
misspell the name of your variable.  Or that the computer will do what it
thinks you intended when you assign a string to a variable and then treat
it as a number or a date.  I generally don't like the computer doing
what it thinks I intended.  I'd rather have it do what I said.

Any student who doesn't take to that kind of an intro, or who can't
understand different data types like integer, string, etc., is probably
not going to do well in the field of computers anyhow, and ought to be
warned off early.  The kind of person who does well in computers is a
person who enjoys problem solving, knowing the rules, etc.  They want
all black boxes to have clearly defined boundaries, and a promise that
someday soon we will open the box and understand it too.  They find it
very frustrating to deal with vague amounts of magic that may or may not
do what they expected.  At least, that's been my experience.

Since you asked...

--Fred
--------------------------------------------------------------------------
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- "Glad to be of service!"
--------------------------------------------------------------------------

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug