On Sun, Feb 10, 2002 at 10:09:55AM -0800, John wrote:

Warning:  Potential flame bait ahead, probably from John and from me.
Please don't take things the wrong way.  Let's ensure that any followups
remain civil and technically correct.

> Don't get me wrong, I think Perl is great and has it's place, and I know I'm
> no authority, but I don't consider Perl a good language for new CIS/CS
> students for a number of reasons including:

I think I understand some of your concerns here, and I have a certain
sympathy with your argument, but

> It's technically a scripting language, not a programming language.

And the difference is?

> It's "object-oriented" system is an afterthought.

But works remarkably well.  Yes there are some shortcomings, but the OO
system fits in with Perl's philosophy of providing enough rope.  You
don't have to use it all.

One could also argue that the "object-oriented" system of C++ is an
afterthought.

> Variables are loosely typed.
> It allows constructs such as routines returning multiple values which are
> unthinkable in good programming practice.

Unthinkable?  What is wrong with returning a list, as opposed to a
reference to a list for example.  How should you manage a function from
which you want to return multiple values?  Return a complex structure?
Use call by reference and modify the function's arguments?  Global
variables?  Make it OO and modify the object?

> It's cryptic.

No.  Some Perl programs are cryptic.  So are some programs in every
other language.  It's also possible to write extremely clean and
understandable code in Perl, and it's probably easier to do so in Perl
than in most other languages.

> It has too many special symbols.

So don't use them.  You'll rarely need more than a few of the common
ones anyway.

> It makes things that should challenge a beginner too easy

I thought that was called progress.  If you want to write a linked list
or qsort in Perl, you can certainly do so.  It's just that most people
don't want to.  And do people really want to worry about memory
management?

>                                                           and allows things
> that should not be allowed for beginners.

If I knew what things you were talking about, I would imagine that this
is for when you stop being a beginner.  And I'm not sure you can really
keep a straight face if you claim that C stops beginners doing silly
things.  Write off the end of an array.  Return a pointer to a local
variable.  Cast to the wrong type.  Mess up your memory management. ...

> For these reasons it teaches programming practices that can at best be hard
> to apply to other languages (I don't think anybody writes in just one
> language) and at worse lead to poor code.  So if you take something written
> in Perl and try to do it in C, it can be a real challenge (though converting
> from C to Perl can be very easy).

This is because Perl is a much higher level language than C.

> If you want to learn good sequential programming practices, maybe start with
> C.  If you can master C you can apply it to many other languages (by
> contrast, Perl-specific knowledge is hard to apply elsewhere), and Perl will
> seem easy.  If you want to learn object oriented programming practices,
> probably start with Java.

I understand this position, but I don't think that C and Java are the
languages you should be promoting here.  Possibly Modula and Smalltalk
might be better suggestions.

I agree with most of the rest of your message.

To a certain extent, I've played Devil's Advocate here, but I think the
real issue is that while Perl allows sloppy coding it certainly doesn't
encourage it.  Certainly Perl is not a perfect language, and some of its
shortcomings are being addressed in Perl 6.

To a certain extent, Perl is a way of thinking.  It sits well with some
people, but not with others.  Once you work with the language instead of
fighting it, you can concentrate on solving your problems rather than
working out how to program them.

There are a few Perl tutors around who might have a different
perspective, but from my point of view, turn on strictures and warnings,
exercise a little self control and Perl can allow you to produce clear,
concise, extensible and maintainable code.  What more could a beginner
want?

Unless you want to be an assembly langauge programmer ...

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to