<div dir="ltr"><div dir="ltr">The funny thing is that the object class (a Metaclass) is yet another object than the new instance.</div><div>It
 thus has absolutely no other way to control the construction of this 
new instance, than to kindly ask the instance by sending a message 
initialize.</div><div>Even if it may sound more 
imperative like object setThisTo: 1 andThatTo: Array new, only the 
instance knows how it will do it (or just fake).</div><div>Somehow the instance is thrown away un-initialized in the world, and we try to repair ASAP. I wonder how Newspeak resolved this.<br></div><div><br></div><div>Systematic send of initialize in Behavior was a relatively late decision (not in Smalltalk-80), that's why I was speaking of method age: self basicNew initialize was the old way to do it indeed, left at discretion of classes when there were no generic initialize method in Object (ProtoObject).</div><div><br></div><div>We can agree that super new is the canonical way to instantiate when additional behavior is required, with exceptions when super new or self initialize won't do the right thing. And instance side initialize should better super initialize too, generally.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 4 sept. 2019 à 23:58, Chris Cunningham <<a href="mailto:cunningham.cb@gmail.com">cunningham.cb@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Non-scientific sampling, there are many places where new sends basicNew initialize, so the sender either wasn't aware new already did that, or didn't trust Behaviour>>new to keep doing that.  Those can obviously just be fixed if desired.  (Monticello code seems rife with this, interestingly).<div><br></div><div>One specifically called out "Superclasses might [do something wrong]" to justify calling #basicNew in #new.  Many callers are class side methods that intentionally setup the variables in subsequent calls to the instance created by #basicNew, such as DateAndTime.</div><div><br></div><div>So, a mishmash of reasons.</div><div><br></div><div>-cbc</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2019 at 2:08 PM Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hmm, I just starred at method 'source with it' in a SpurVMMaker image and got</div><div>- 252 hits for 'self basicNew';</div><div>- 109 hits for 'super new'.</div><div><br></div><div>So it might depend on context... This would deserve more statistics (age of method, initials, whether new is raising an Error or not, whether instance side initialize does nothing or the wrong thing, etc...)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 4 sept. 2019 à 22:38, tim Rowledge <<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 2019-09-04, at 12:58 PM, Thiede, Christoph <<a href="mailto:Christoph.Thiede@student.hpi.uni-potsdam.de" target="_blank">Christoph.Thiede@student.hpi.uni-potsdam.de</a>> wrote:<br>
> <br>
> Thank you :)<br>
> <br>
> A very minor question: Would you favor [self basicNew] over [super new]? It will work completely equivalently, but what is the better style?<br>
<br>
^super new<br>
<br>
`self basicNew` will not always work equivalently. And I can almost guarantee it will always do the wrong thing just when you feel sure it is doing the right thing. And you will suffer Debugging Hell.<br>
<br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
Why use one word when two polysyllabic agglomerates will do?<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div>
<br>
</blockquote></div>
<br>
</blockquote></div>