Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

(tye)Re:: Adam:: Re:: OO-style question

by tye (Sage)
on Dec 31, 2000 at 11:01 UTC ( #49076=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re:: Adam:: Re:: OO-style question
in thread OO-style question

Gee, eval {} seems nearly identical to a "try" block to me. It is the "catch" part that you need to add, but several people have already done so. I think if more people were to try more of these modules then soon we'd have some improvement to some of them and then some agreement as to which ones work best and we might even end up with a "standard" module that ships with Perl and modules could start using structured exceptions and things would snowball from there...

The lack of good subroutine prototypes is certainly a problem. Though there are modules that provide different replacements for that (Class::Contract is one that I don't think has been mentioned in this thread yet).

A worse problem is the clumsy nature of Perl's inheritance. Books teaching OO tend to make a big deal of inheritance. Books teaching how to write good code in C++ make a big deal about avoiding inheritance (not avoiding it altogether, just avoiding it unless it is really called for, which it usually isn't). The case for this avoidance is much, much stronger for Perl. You can't inherit only the API (unless you use some module for that -- and the only API Perl defines is a list of method names anyway). You can't have subroutines that aren't also inherited. You can't inherit members (aka member data to those who like to call methods "member functions") (unless you use a module and the ones I've seen still leave much to be desired here). You can't do useless inheritance of useless class data (:

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://49076]
[choroba]: Corion A colleague has helped me. It seems the "Modification of read-only value" was caused by old Test::More version which doesn't have done_testing, plus the old bug with $@ sometimes showing a different exception
[choroba]: will upload a fixed version and see
[Corion]: choroba: Ah, OK - sounds like a really weird combination :)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-06-25 14:14 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.