Sorry for the rant below, these are just my own, very heated, views on the topic.

I've already banned "class" from all my projects. It's way to inflexible.

While i generally like the style of declaring class variables and them the functions contained, the new class system feels way to restrictive and limited. And as we discussed in Thoughts on new 'class' OO in upcoming perl, i think the approach of "it's good for newbies, and later they can upgrade to using bless" is complete nonsense. As i've stated before:

In my opinion, the ability of a language should suffice for experts, but at the basics should be easy for novices to learn. Without limiting their ability to use already learned stuff later when they start to climb their ladder to become an expert.

As it stands now, "class" simply doesn't qualify. It introduces an artificial ceiling that requires re-learning Perl OO (using bless) and a complete rewrite of your code when the problem you need to solve gets more complex.

I don't want to step on anyones toes, but class seems to be designed and optimized to look pretty and modern, functionality be damned. Which, in a way, is funny because people like me switched to Perl not because of how pretty it looks but because it has a much more flexible approach to, well, everything. The ability to bend the language to the problem, not the other way around.

I also find the idea somewhat funny that a new, "more readable" OO system will attract new users because it makes the code easier to read. Pretty much every book on Perl introduces inline regular expressions in like chapter 2 and array slices/map/grep in chapter 3. If people can learn that stuff without running for python, blessy OO in chapter 10 isn't going to turn them away, either. XS in chapter 15 might be a different story, though...

Yes, Perl could certainly use a more modern OO that is build into the language. But it should be at least as flexible as what we already have, but easier to use. Make it easier to learn, yet enable the experienced experts to bend it to whatever edge case requirements come up today.

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

In reply to Re^7: perl 5.38: can the body of a class declaration contain arbitrary code? by cavac
in thread perl 5.38: can the body of a class declaration contain arbitrary code? by jdporter

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.