I agree with that, but in some cases, like reading objects from an ORM, you would be creating lots of instances of objects that are going to be discarded right away. This would put no stress on GC since it would happen in the "new" space, but would consume more memory (although I never measured how much more). Esteban A. Maringolo On Wed, Jul 24, 2019 at 1:14 PM Richard Sargent <richard.sargent@gemtalksystems.com> wrote:
I will add that I prefer the static model to tell the truth about its data types. So, I prefer having an #initialize method which ensures the new object is created in a self-consistent way and anyone looking at it in an inspector will see useful and correct information. Leaving instance variables uninitialized is a excellent way to generate Does Not Understand errors (perhaps not in the short-term, but definitely in the long-term).
On Wed, Jul 24, 2019 at 8:39 AM sergio ruiz <sergio.rrd@gmail.com> wrote:
tracks ^tracks ifNil: [ tracks := OrderedCollection new ].
- one line - does not mix using accusers and not using accessors.
Okay, I totally get the subtlety now. I donât even need an accessor.
Thanks!
---- peace, sergio photographer, journalist, visionary
Public Key: http://bit.ly/29z9fG0 #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV http://www.codeandmusic.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101