<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2013/12/24 Chris Muller <span dir="ltr">&lt;<a href="mailto:ma.chris.m@gmail.com" target="_blank">ma.chris.m@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">&gt; The reason I keep dissing them as setters is because they only set<br>
&gt; _some_ state.<br>
<br>
</div>My goodness Frank.  After all this you still are saying that?!  Please<br>
forgive me for correcting you one last time with emphasis.<br>
<br>
*** CPM&#39;s set ALL STATE required for a well-formed, functional object ***.<br>
<br>
That&#39;s also why I committed Environments-cmm.38 as a multi-variable example.<br>
<br>
Setters set one variable.  **Constructor Parameter Methods set ALL<br>
variables passed from a constructor**.  A Constructor is, by<br>
definition, a method capable of &quot;constructing&quot; a well-formed instance.<br>
<div class="im"><br>
&gt; Now, granted, some like Point &gt;&gt; #setX:setY: happen to<br>
&gt; fully initialize an instance, but the name does not make this<br>
&gt; responsibility clear.<br>
<br>
</div>The name makes clear *what it does*.  If it&#39;s #initializeWith: -- you<br>
better look at the method to know what it does besides set state..<br>
Plus, a constructor can&#39;t ONLY set state, it implies some sort of full<br>
&quot;initialization&quot;.<br>
<br>
But, I&#39;m repeating myself from 3 days ago..   :)<br>
<div class="im"><br>
&gt; But (the nonexistent) Point &gt;&gt;<br>
&gt; #initializeWithX:y: tells you loudly and clearly that the method<br>
&gt; initialises the instance. That &quot;#initializeWithX:y&quot; is ugly to look at<br>
&gt; and painful to type is just gravy: you shouldn&#39;t be calling that<br>
&gt; method anyway.<br>
<br>
</div>Not any more than you should call setX:y:.  Seriously, have you ever<br>
had the urge to call that?  I always check the protocol of methods I&#39;m<br>
unsure about, and if it&#39;s correctly categorized, then you&#39;re relying<br>
on an ugly selector name, initializeWith: to &quot;fix&quot; something that<br>
isn&#39;t broken.<br>
<br></blockquote><div><br></div><div>It&#39;s a bit late for changing that now, but it could as well be named initializeX:x y:y to carry the exact intention.<br>Not every body knows that you should set once, more people know that you should initialize once and only once.<br>
</div><div>So you could have just change With:, it would have been less controversial.<br><br></div><div>The other point being whether to invoke new or basicNew is more germane, but not invoking new is a way to tell my instances are not created like that. We could push it further and redefine new ^self error as you suggested, but it&#39;s quite heavy...<br>
</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But I&#39;m sounding like a broken record so... later.  :)<br>
<br>
</blockquote></div><br></div></div>