in reply to Re^4: Moose: I want builder method to run every time I call an attribute (ugh)
in thread Moose: I want builder method to run every time I call an attribute

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

  • Comment on Re^5: Moose: I want builder method to run every time I call an attribute (tyeoopood)