[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
globals considered harmfull.
Self Style Suggestion:
If I want to produce an instance of something, I believe it is better
to ask the traits object for it.
I propose that most traits objects should respond to a 'new' invocation
- it allows the posibility of parameters to determine the contents.
- it doesn't preclude having globals as well
- a 'new' mixin is easily defined
- a lot of traits already have a prototype slot
- its less code in the clients, you don't have to use explicit "copy"'s
- it is closer to the smalltalk model, hence easier to learn
Currently:
- accidently forgetting the copy is a real screw up, you end up
modifying the prototype
-Ian
p.s. I'm obviously missing something here... I'm quite prepared to be
persuaded...
p.p.s. Is there any kind of style guide anywhere? (I have read the User
Manual)
p.p.p.s. Long term, languages are port or die. How portable *is* Self?