[aklug] Re: Perl 5 OOP

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Thu Jan 07 2010 - 12:20:50 AKST

On Wed, 6 Jan 2010, Christopher Howard wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Okay, well here's a semi-random thought for the list:
>
> Perl 5 OOP sucks. Even with Moose.
>
> I guess I've been pampered lately, working mostly with C++ and Java.
> Actually, Java has pretty cool feature which I just found out about
> recently (being a Java n00b) called interfaces, where you can actually
> define an interface (a sort of completely abstract class) and just
> attach it to any class you want, independent of the inheritance hierarchy.
>
> Anyway, right now I'm working with Perl because of a cool Perl module,
> but I have to switch my code over to OOP, and even the Moose interface
> seems awkward.
>
> I guess Perl 6 is supposed to improve that, but as Perl 6 doesn't even
> seem to be in the Gentoo repositories yet, I'm probably not going to
> play around with it.

Perl OOP was intentionally vague to allow for flexibility. I kind of see
arguments like these similar to postfix versus sendmail -- both do the same
job, but there's a huge degree of difference in the range of flexibility.
In short, Perl does OOP, but it isn't pendantic about it. You're allowed to
leverage as much of it as you like, and still mix it with functional &
procedural styles.

Personally, I like the flexibility. I'd take that over the Java-based
mentality, where simple things like arrays are objects(?!). You pay
a price for that level of abstraction. At least in Perl you have a chance
(and a choice) to do more low level optimizations where you like. Of
course, I don't do OOP as much because it doesn't make as much sense for my
kind of work.

Basically, Perl appeals to those of us coming from lower level languages
like C. Don't expect it to be comparable across the board with other
strict high-level languages.

And remember, you may not like it, but I'll bet everyone here is using it,
consciously or not. :-) It's the one higher-level language that's
included out of the box on every major UNIX (and clone) under the sun. Try
taking it off your system, and see what breaks.

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu Jan 7 12:21:22 2010

This archive was generated by hypermail 2.1.8 : Thu Jan 07 2010 - 12:21:22 AKST