Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

(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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://49076]
help
Chatterbox?
[tye]: Is it just me, or do most python things have terrible logging/errors?
[LanX]: but but but ... the errors are nicely formatted!
[tye]: 1) The python stack traces show you the names of variables, not the values of variables. Almost never informative.
[LanX]: do you have a py job now?
[tye]: Right now I have errors trying to fetch stuff from graphite. It says 'apps not ready, check startup logs'. I eventually find the startup logs and see 'no apps found'. Looking for fixes to this problem...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-09-21 20:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (252 votes). Check out past polls.

    Notices?