[PLUG] Is PHP a good intro programming language?

Steven Adams stevea at nwtechops.com
Thu Jan 30 15:56:01 UTC 2003


On Thursday 30 January 2003 08:38, Felix Lee wrote:
> no.  I already said earlier in the thread that I don't think
> first language matters much.  I'm fond of Scheme, but I
> don't think it will work for everyone.  Smalltalk and Logo
> are also fun choices.

You have to understand that if the first language is either difficult or not 
productive then the student is much more likely to lose interest and quit 
(especially young students). Show them that it's fairly easy to create and be 
productive and they will likely stick it out. Originally I suggested shell or 
Perl scripting because of availability, free documentation, ease of use and 
full of features.

> one idiotic problem with Perl is it doesn't do function args
> like any other language.  it takes at least 3 lines of code
> to do what most other languages do in 1.  this _doesn't
> matter_.  a problem like this just means you teach someone
> the 3 lines instead of the 1, probably with an explanation
> of why it's necessary.  though too many digressions like
> this may get in the way of learning the meat of programming.

You don't like having all of your parameters flattened into @_  :)  (I share 
that feeling).   And I beg to differ, every Perlmonger that turns to C for 
the first time appreciates the fact that Perl passes parameters badly and 
conforms to the new language with pleasure (in that respect). Now here's a 
challenge:  Find a language that nobody can poke stupid holes in...

> I think good programming habits have little to do with
> language.  good habits are: writing clearly, writing
> precisely, and obsessive paranoia.  Perl is a little worse
> than average in supporting those, so I'm puzzled why you
> consider it "a really good choice".

Quite simply, experience tells me that learning concepts by example is much 
more powerfull than by idiology and theory. We'll have to agree to disagree 
when it comes your theories of good (code) writing habits - I'm really 
puzzled why you would think that someone with no knowlege of the language 
could write code precisely and clearly (I liken that to me speaking fluent 
Japaneese without studying that lanquage).

> I mean, simple programming ideas like lexical scoping were
> added to Perl late, and there are a couple of ways that
> lexical scoping doesn't work in Perl.

The is true, but subject to opinion that some don't share, I happen to agree 
with that statement. But then again, the common misuse of pointers in C++ 
caused them to be eliminated in Java - some would say it was the 
implementation of pointers in C++ that promoted said pointer to be commonly 
misused.

> big deal.  Perl is ok.  PHP is ok.  if someone's going to
> become a serious programmer, they're going to learn general
> programming language theory anyway.

I can't agree with that statement more.  Every language has it's pros and 
cons, there nothing but tools. So when introducing someone to programming it 
could be said that the language needs to be one that the student finds 
facinating.




More information about the PLUG mailing list