<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 26, 2016 at 6:42 AM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I agreed that it looked good in the ivory tower.  The thing is, there<br>
are these real-world detractors which we should not igore.  To save my<br>
old fingers, let me just summarize them from the earlier posts.  In<br>
summary:<br>
<br>
  - it provides no known material benefit<br></blockquote><div><br></div><div>Having an O(1) runtime vs O(n) is a very large material benefit. Collection&gt;&gt;size is O(n) so it&#39;s not a good base for #isEmpty.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  - it could affect unsuspecting legacy application performance<br>
materially, and in an insidious way<br></blockquote><div><br></div><div>If you have performance problems, profile.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  - it&#39;s an anomalous usage of the API which works against performance<br>
expectations about #size and #do:.<br></blockquote><div><br></div><div>The performance expectation of both #size and #do: in Collection is O(n). And there is nothing &quot;anomalous&quot; in using #do:, quite to the contrary, #do: is the *essence* of a collection of objects.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  - the justification for this change (performance optimization) in<br>
Collection is not valid in the first place.<br></blockquote><div><br></div><div>It is very valid optimization given the implementation of Collection&gt;&gt;size.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No real-world positives, just negatives or zeros.  Please revert.<br></blockquote><div> </div></div>Quite the opposite. It&#39;s a major improvement in basic API.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Yes, you will have to provide an optimized #isEmpty now, because you relied on an implementation detail of a superclass.  But there never was a contract that #isEmpty needs to be implemented in terms of #size. The new implementation makes much more sense for an arbitrary abstract Collection, so I&#39;d like to see it stay.</div><div class="gmail_extra"><br></div><div class="gmail_extra">- Bert -</div><div class="gmail_extra"><br></div></div>