<div class="gmail_quote">On Wed, Mar 30, 2011 at 2:55 AM, Tristan Seligmann <span dir="ltr">&lt;<a href="mailto:mithrandi@mithrandi.net">mithrandi@mithrandi.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Mar 29, 2011 at 5:08 PM, Christopher Armstrong<br>
&lt;<a href="mailto:radix@twistedmatrix.com">radix@twistedmatrix.com</a>&gt; wrote:<br>
&gt; I probably use addCallbacks once for every 30-100 addCallback or addErrback<br>
&gt; calls I do (counted by lines of code, not times they&#39;re executed). But<br>
&gt; that&#39;s just an off-the-cuff estimate.<br>
<br>
</div>For interest&#39;s sake, I just ran the numbers on my largest codebase (a<br>
proprietary application, sorry); ratio of addCallbacks to (addCallback<br>
+ addErrback) is around 0.05.<br>
<font color="#888888"></font></blockquote><div><br></div><div>Funny, that&#39;s what I got on my proprietary application (0.0597) :-) It&#39;s a heavily inlineCallbacks-based codebase, and I expect there would be a much larger number of addCallback/addErrback calls if it weren&#39;t. Also, looking at the actual uses of addCallbacks (15), they were all written by people other than me (relative Twisted newbies) and I don&#39;t think I would have used it where it&#39;s used now. This, I think, indicates that we *should* focus more on addCallback and addErrback in the documentation, and stress that they are almost always what you want to use instead of addCallbacks, but definitely point out where addCallbacks is useful.</div>
<div><br></div><div>-- </div></div>Christopher Armstrong<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://planet-if.com/">http://planet-if.com/</a><br><br><br>