in reply to Overload abuse or is it just me?

From what I recall, Perl 6 will have similar concepts of piping. The difference, however, is that perl 6 gets the advantage of being able to define brand new operators, while the developer(s) of FEAR::API or even IO::All can't. (They would be able to define new operators in perl 6 - but now we're getting ahead of ourselves.) Thus, someone with some clout in the design of perl 6 has decided that this type of development is a Good Thing (tm) - both the piping and the ability to define new operators that the designers of the language didn't anticipate. I don't disagree - coming from some experience with C++'s IO streams, I thought they were clever overloads that had the advantage of becoming standard and thus not funny looking (anyone who had C++ experience would be expected to be familiar with them), and where they used >> and << only because they couldn't create a new operator (and then it was stuck before a new operator could be defined).

However, this is not standard in perl 5. For that reason alone, I would discourage it in anything approaching production (and thus maintainable) code. I would suggest your last example, the "full OO" one, to be the best use of Perl 5 as Perl 5.

Replies are listed 'Best First'.
Re^2: Overload abuse or is it just me?
by eric256 (Parson) on Mar 18, 2006 at 03:46 UTC

    I think the advantage in perl6 is that you can create *new* operators. That means the modules don't have to overload already used operators. For instance I've played with building a units module that overloads 'ft' and 'in' as postscript operators. But if you see my $distance = 5ft + 6in; You know that something new has happened here since those arn't standard operators. ;) Just my two cents.


    ___________
    Eric Hodges