At 02:45 PM 1/23/2002 -0800, Glenn Linderman wrote:
>Melvin Smith wrote:
> > Referring to final, private, etc. modifiers that you can use in C++/Java
> > whenever you don't want someone reimplementing or overriding something.
>
>final and private are completely different concepts as I understand
>them.

I wouldn't say "completely different". They are both used for "enforcement"
of similar means, but you are correct, they are different.

>to see.  This is considered a good thing in compiled code where users
>code to the interface, and cannot see the implementation.  In Perl, the
>implementation is generally visible, and privacy would be somewhat
>fictitious, albeit perhaps a useful one at times.

Likewise in C++/Java/etc., its just a policy, not an absolute law.
I wasn't debating the usefulness of them anyway, just noting
the availability; and I thought it was relevant to the original comment
by Mr. Me.

>Final seems to be a way of sealing off a class or method from future
>inheritance.  Generally, the arguments I've seen on OO lists seem to
>indicate that regardless of how omniscient the original designer is,
>someone will get an idea for a useful subclass for the class or method,
>but run into the problem of not being able to extend it because of the
>superclass implementor's choice to make it final.  Hence, final seems to
>be a concept that is rather un-Perl-ish.

Thats one contrived example that I've heard before, but that is more about
decisions on where to use it, not whether it is good to have in your toolbox.

Anway, sorry to start this tangent, it probably has little interest for the
rest of the guys here. :)

-Melvin


Reply via email to