<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/12/24 Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>></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">> No there are already different ways to initialize.<br>
> For example, take the collections, some of them #initialize: not #initialize<br>
> in order to pass a size (or capacity) to the initializer.<br>
> So the pattern used by Colin is pretty common in Squeak.<br>
> I invoked the case of Point more for the fact it sends basicNew instead of<br>
> 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's more or less the same of what I earlier said: you do not want instance variables to be initialized twice.<br>It'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">
> There are indeed two different things on the table<br>
> 1) to have a single initializer<br>
> 2) the names chosen for initialization<br>
><br>
> Chris, the name count, you can't rename initialize -> set and declare this<br>
> is not a setter, it's quite surrealist and make me think of<br>
<br>
</div>You think the "set" prefix makes it a setter? Even though no<br>
Smalltalker prefixes their setters with "set" and also it sets<br>
multiple variables and also is categorized under "initialize-release"<br>
instead of "accessing"?<br>
<br>
That is three differences from what we think of as a "setter". But<br>
you say something that is different in 3 ways is "surreal" 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">
> <a href="http://en.wikipedia.org/wiki/The_Treachery_of_Images" target="_blank">http://en.wikipedia.org/wiki/The_Treachery_of_Images</a> ;)<br>
><br>
> I suggest we concentrate on 1) - the single initializer pattern.<br>
<br>
</div></div></blockquote></div>But let's concentrate on this one as I suggested :)<br></div></div>