develooper Front page | perl.perl5.porters | Postings from August 2012

Re: [perl #114460] RFE: class as conditional self-defining keywordfor package

Thread Previous | Thread Next
David Mertens
August 13, 2012 18:38
Re: [perl #114460] RFE: class as conditional self-defining keywordfor package
Message ID:
On Sun, Aug 12, 2012 at 6:04 PM, Jesse Luehrs <> wrote:
> On Sun, Aug 12, 2012 at 03:58:14PM -0700, Linda W wrote:
>> The problem is that "Core" doesn't have pure classes -- it has modules, yet
>> it represents itself as an OO language.  The modules have requirements that
>> classes don't -- inherently, tying 'concept' to implementation is an
>> anathema
>> to OO design.   Adding a package to CPAN won't change the problem in Core.
> One of our medium-term goals for the language in the next couple of
> years is to add the concept of real, actual classes to the perl core.
> I'd be against adding this idea to core if only because of namespace
> clashing issues (a real class implementation will also want to be able
> to use the 'class' keyword).
> -doy

I happen to agree with Jesse on this point: at the very least, don't
use the reserved word "class".

In general, though, is your point of contention not solved by a well
written SYNOPSIS section in the module's documentation? Unlike other
languages, Perl makes documentation writing very simple, and a well
written SYNOPSIS should make it very clear what needs to be "use"d in
order to get the class properly pulled in.


 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About