Skip to main content


My biggest mistake in the design of the new object system for the #Perl core is that I didn't make methods private by default.

Had I proposed it, I think it would have been the right thing to do. Pretty sure there would have been a rebellion against me.

#perl
in reply to Curtis "Ovid" Poe (he/him)

I think private by default would be correct in theory

but

in terms of getting it accepted into core feature class,
that would yes likely have been fatal, or removed as a condition for moving forward,

so ... no harm no foul ?

Unknown parent

mastodon - Link to source
Bill Ricker
@perigrin
True enough.
But as thoroughly as we collectively ^embraced^ (read: rejected) the data encapsulation of Inside-Out Classes that were in vogue (supposedly) around the debut of PBP, i expect we'd want actual enforcement of _private() methods but not reversion to pre-OO-modularity of " what you forget to export isn't visible interface"; default private with :public attribute would at least make it clear at the useful spot but.
in reply to Bill Ricker

@BRicker @perigrin I think a lot of the the difficulty with inside-out classes is that they were difficult. It was tricky to get them right and after a while, people shrugged and went the easy way (as I did, too). If you make doing the right thing hard, people don't do it.
in reply to Curtis "Ovid" Poe (he/him)

@perigrin yes, affordances matter.

An :attribute to decorate a whole class once, to set default pub/privacy for the class might make it easy to do tight encapsulation when needed and loose or heritable access also easy.

in reply to Paul Evans

@leonerd @perigrin in which case Ovid's hypotheticalb alternate choice upthread would be less problematic than i initially expected.