in reply to Re: oop, variable that counts the number of objects created
in thread oop, variable that counts the number of objects created

not germane to OP but generally relevant

Nice to see this example. I should probably ask this in another thread, but what's the obsession with has? Can't we (everyone not just your modules) just have blocks all the way down or superficially support something that's familiar to JAVA programmers? At this point we're just cargo culting a failed declarative approach (IMO). What are we getting beyond classic Perl OO? (sincerely want to break this down for the benefit of the overall discussion):

What else? If this has been hashed out before (a true breakdown), I'd be satisfied with a link. TY!

Replies are listed 'Best First'.
Re^3: oop, variable that counts the number of objects created
by tobyink (Canon) on Jul 30, 2020 at 17:01 UTC

    Why would declaring object member variables with blocks be familiar to Java programmers?

    # Java class Car { public String name; public int price; public int speed; } # Zydeco class Car { has name ( type => Str ); has price ( type => Int ); has speed ( type => Int ); }

    Where would you add blocks to the Zydeco example to make it more like Java?

      Just a general thought, why is has so pervasive? Idk I probably should think more about what I am really trying to figure out. This is not about your modules specifically.
        why is has so pervasive?

        Because encapsulation helps prevent action at a distance, structured naming helps prevent typos in operator-typed languages such as Perl, and syntax helps disambiguate semantically different things.