Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Thoughts on new 'class' OO in upcoming perl

by cavac (Prior)
on Mar 08, 2023 at 17:14 UTC ( [id://11150854]=note: print w/replies, xml ) Need Help??


in reply to Re: Thoughts on new 'class' OO in upcoming perl
in thread Thoughts on new 'class' OO in upcoming perl

Well, and some of your points are just plain wrong.

That's why i discuss this sort of stuff on PM, instead of ranting about "the unfairness of it all" somewhere else on the internet. I always strive to learn ;-)

Your example of a subclass setting a field to a fixed value has been discussed in great length in the GitHub discussions on Corinna

As long as it's a topic that isn't forgotten, i'm happy. If in the end the decision is "we will not allow that", i can live with that and will find ways to integrate "the new way of doing things" in my code.

Instead, the declarations of the parent classes are evaluated by the auto-generated new-method, and the ADJUST-block of the parent is called

I assume the ADJUST call order is this:

  1. grandparent
  2. parent
  3. current class

Correct?

However, ignoring Moo* is, well, ignorance.

I didn't ignore Moo* as such. I looked into it (a long long time ago, though). I dimly remember it seemed to have a lot of performance and RAM usage problems, at least for my workloads. And it didn't bring enough benefits for my single-developer projects to make sense.

Things might have changed. And having a newer OO system integrated into Perl core is a different ballgame altogether.

But to be fair, i can be a very stubborn, ignorant person sometimes who likes to do some things "the old ways". But if i find some new way that i like more, i'am not unknown to become a preacher of those "new ways of doing things". I haven't yet decided if i will "go class" or "stay bless". But you can take it from the time i've taken to look into it and discuss it here on PM that i think it certainly has peaked my interest in a serious (and good) way. If i thought "class" was rubbish, i would have just ignored it completely ;-)

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
  • Comment on Re^2: Thoughts on new 'class' OO in upcoming perl

Replies are listed 'Best First'.
Re^3: Thoughts on new 'class' OO in upcoming perl
by hippo (Archbishop) on Mar 08, 2023 at 17:38 UTC
    I didn't ignore Moo* as such. I looked into it (a long long time ago, though). I dimly remember it seemed to have a lot of performance and RAM usage problems, at least for my workloads. And it didn't bring enough benefits for my single-developer projects to make sense.

    The asterisk is doing a lot of work there. Moose has always been and continues to be a beast (appropriately enough). That is to say it is big, slow and includes a ton of stuff I will never use - YMMV. OTOH, Moo is much smaller and leaner and I've had success using it without being too disappointed with the performance. However, for me (and this is very much an individual opinion) Class::Tiny hits the sweet spot of enough good stuff to be worth using with minimal (basically immeasurably small) overhead. Combine it with Role::Tiny and you have yourself a modern OO system that's bloat free.

    Half the time I still just use bless and friends. Some of those times the model is standard enough that I should have gone with Class::Tiny from the start and other times the flexibility was a bonus. Horses for courses. But no mooses for me.


    🦛

      «Class::Tiny hits the sweet spot…Combine it with Role::Tiny and you have yourself a modern OO system that's bloat free.»

      I have been whistling this tune for quite a long time now. It is nice that I am not alone. I am convinced that you can go far with this system. Very far and beyond.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Re^3: Thoughts on new 'class' OO in upcoming perl
by haj (Vicar) on Mar 08, 2023 at 18:20 UTC

    I am optimistic that the new Perl core OO will get the deserved amount of discussion, like so many of its precedents on CPAN. No harm in different opinions :)

    Regarding your question about ADJUST call oder: You are correct, it is parent first, child last.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11150854]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2025-06-13 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.