in reply to Anyone migrated to the new 'class' way of OOP?

I'm sticking with the old.

From what I read, the rationale for this new thing is to be an MVP of OO syntax for those familiar with other languages to port stuff easily to core Perl without having to worry about Moo, etc. While that's fine, it isn't my use case.

Probably 90% of the OO code I write is classic bless() stuff. When I need/want a bit more it's Class::Tiny for maybe 8% and on those rare occasions even more is wanted then it's Moo for that final 2%. It really doesn't feel like I'm missing out on anything by continuing with this approach.


🦛

Replies are listed 'Best First'.
Re^2: Anyone migrated to the new 'class' way of OOP?
by cavac (Prior) on Aug 25, 2025 at 10:42 UTC

    I'm also sticking with bless() for now. For my use cases, it is still the most flexible way of doing things. I often need to run code before and after SUPER::new(), and i have quite a few modules that have multiple new() functions, depending on how i want/need to initialize them. And factory classes, multiple inheritance, etc...

    Not to mention that rewriting a lot of my (tested and proven to work) codebase would be a huge undertaking, and mixing OO systems within a project seems like a very bad idea.

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
    Also check out my sisters artwork and my weekly webcomics