Re: Help! Strings -> Numbers
[email protected] (Michael Lazzaro) Thu, 21 Nov 2002 09:54:34 -0800
| Newsgroups | perl.perl6.documentation |
|---|---|
| Message-ID | <[email protected]> |
On Thursday, November 21, 2002, at 12:24 AM, Dave Storrs wrote:
> On Thu, Nov 21, 2002 at 01:29:32AM -0500, Tanton Gibbs wrote:
>> Properties have bothered me, but for a different reason. It appears
>> that everyone's answer to everything is "make it a property!"
>> Properties are just strange to comprehend...they are like hidden
>> attributes that are squirreled away until you least expect >> them...then
>
> I would say that properties are very powerful and, like most powerful
> things, could easily be abused.
If I'm understanding them correctly, another way to think of runtime
properties is "dynamic inheritance", or more specifically
"instance-based inheritance". When you say:
$v but foo(5);
You're saying that instance/value $v now inherits the behaviors of
foo(5), in addition to it's normal behavior. Well, sortof.
So while they're essential for certain things, I expect they might be
*much* more expensive (runtime) than either method calls or normal,
"static" class inheritance. You're taking the particular
value/instance and adding another layer of behavior to it -- behavior
that is only calculable at runtime. Ouch!
So yeah, I think they should be avoided except when necessary -- to
make an object do something that is wasn't originally designed to do,
but not as a syntax for a core feature. I would hope most of the core
uses them very sparingly.
MikeL