<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/12/24 Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">&gt; No there are already different ways to initialize.<br>
&gt; For example, take the collections, some of them #initialize: not #initialize<br>
&gt; in order to pass a size (or capacity) to the initializer.<br>
&gt; So the pattern used by Colin is pretty common in Squeak.<br>
&gt; I invoked the case of Point more for the fact it sends basicNew instead of<br>
&gt; new, than for the names.<br>
<br>
</div>The only reason Point sends basicNew instead of new is for<br>
performance.  Morphic applications create millions of Point instances<br>
and so an exception is made to avoid the extra send, nothing more.<br>
<div class="im"><br></div></blockquote><div><br></div><div>That&#39;s more or less the same of what I earlier said: you do not want instance variables to be initialized twice.<br>It&#39;s considered an anti-pattern for two reasons<br>
</div><div>1) useless waste if CPU cycles<br></div><div>2) useless trouble for who wants to understand how the class works (think of debugging)<br></div><div> <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 class="im">
&gt; There are indeed two different things on the table<br>
&gt; 1) to have a single initializer<br>
&gt; 2) the names chosen for initialization<br>
&gt;<br>
&gt; Chris, the name count, you can&#39;t rename initialize -&gt; set and declare this<br>
&gt; is not a setter, it&#39;s quite surrealist and make me think of<br>
<br>
</div>You think the &quot;set&quot; prefix makes it a setter?  Even though no<br>
Smalltalker prefixes their setters with &quot;set&quot; and also it sets<br>
multiple variables and also is categorized under &quot;initialize-release&quot;<br>
instead of &quot;accessing&quot;?<br>
<br>
That is three differences from what we think of as a &quot;setter&quot;.  But<br>
you say something that is different in 3 ways is &quot;surreal&quot; to call it<br>
something else..   You need to refine your pattern language!   :)<br>
<div class=""><div class="h5"><br></div></div></blockquote><div><br></div><div>Chris, the 3 arguments setter was added afterward.<br>The 1st method you modified and that made all of us react was setPrefix:<br></div><div>
If it does not quake enough like a setter, then what does? Be fair.<br></div><div><br></div><div>I agree that a Smalltalk-centric setter would be named prefix: in our tradition.<br></div><div>But if you look a bit wider around us, setters are just named set (java C++ python whatever...).<br>
</div><div>So initializePrefix: is a clear disambiguation now that Smalltalk is not alone in its world.<br></div><div>And IMO, classification is a hint, but is not enough.<br><br></div><div> <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 class=""><div class="h5">
&gt; <a href="http://en.wikipedia.org/wiki/The_Treachery_of_Images" target="_blank">http://en.wikipedia.org/wiki/The_Treachery_of_Images</a> ;)<br>
&gt;<br>
&gt; I suggest we concentrate on 1) - the single initializer pattern.<br>
<br>
</div></div></blockquote></div>But let&#39;s concentrate on this one as I suggested :)<br></div></div>