[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: globals considered harmfull.
It's been a lot of fun to follow this discussion.
I think what started it was Ian's realization of the
"corrupted prototype problem" as we call it.
And this is a real problem that hints at a problem with the language.
But, I am not ready to give up and ask the traits object to create a
For one thing, this is less concrete, as the traits object must get some
additional knowledge from somewhere hidden.
Also, there is a style of programming in which you do not create
traits--even for multi-"instance" objects, and I would not
want to discourage it. (Traits are still used when you need to
change inherited info on-the-fly, i.e. for long-lived
One way to mitigate the prototype-corruption problem that I
am seriously considering would be to make "globals" no longer
be a parent and to change its name to something shorter, like "the".
The drawback: every time you refer to a prototype, you would have to say
"the point copy" instead of "point copy".
The benefits: slightly harder to forget copy, and better for showing
all of an object's inherited attributes in a single place.
(Solves a problem that is facing Kevo).
Anyway, thanks for an interesting discussion!