Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I have these bookmarked/tagged with oop and tye and in proximity to each other
How Large Does Your Project Have To Be to Justify Using Moose?,
Re^2: Two simple code style advice questions (tye)
module w/ object-oriented and functional interfaces: best practices?
Advice please on variable naming style in modules
Re: Object Oriented Orientation
encapsulation violation Re: Programming patterns Programming patterns
Moose class design for game

And tye in the cb around the same time( 2011-06-18 06:23:39 UTC )

the Moose will bite you in the end
The classic steps of bad OO design are done in the following order: 1) Figure out which classes inherit from which other classes, 2) Figure out the attributes of each class, 3) Starting writing methods.
ugh. data-type-based validation. If you want C++, you know where to find it. That's another thing Moose promotes that I find problematic.
So, Moose pretty much forces you to only use attributes via accessors (that it generates). This forces your attributes into public view and leads to classes with lots of accessors. Bad design.
Never inheritance! Though, you'll want simple delegation sometimes and there isn't a great solution for that yet (I'm working on it)
It leads to fragile and overly complex design for a ton of reasons.
The argument 'for' is that it can then be easy to muck with things in several rather unstructured ways. Rather like the argument for 'goto'. You don't have to bother to make the design structure clear. Just slap things however.
No, I think OO is great. Inheritance sucks big time.
Roles improve inheritance in some fairly superficial ways but don't fix the bad design aspects much if at all.
And my disagreement with Moose's take on OO is not anything about 'anal'. It puts way too much stress on accessors, encourages validation only via data types. It adds the worst aspects of C++ and doesn't implement many good, required parts
I don't mind having a good structure for doing OO. Moose got a lot of things right about that. But the negative still outweighs the good, IMO.
Every so often I have to go find some good old hackers and ask them if inheritance is good so they can laugh at me and remind me how stupid the old-timers realize it is. This knowledge is not only not shared by enough people, but ...

I also bookmarked https://metacpan.org/source/ZBY/WebNano-0.007/webnano_article.html/http://cpansearch.perl.org/src/ZBY/WebNano-0.007/webnano_article.html meaning to ask something about coupling controllers, but I don't remember

I also remember that tye is writing a oop/ood book(let?) , can't wait for 50 shades of tyed oops


In reply to Re^5: Moose: I want builder method to run every time I call an attribute (tyeoopood) by Anonymous Monk
in thread Moose: I want builder method to run every time I call an attribute by italdesign

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found