<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Justin Warren wrote:
<blockquote cite="mid:1206430756.9271.43.camel@localhost" type="cite">
  <pre wrap="">On Sun, 2008-03-23 at 03:48 +0000, <a class="moz-txt-link-abbreviated" href="mailto:glyph@divmod.com">glyph@divmod.com</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">On 22 Mar, 01:54 pm, <a class="moz-txt-link-abbreviated" href="mailto:mithrandi@mithrandi.net">mithrandi@mithrandi.net</a> wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">But yes, the danger of accidentally serializing operations that don't
need to be serialized, and not even realising it, is one of the 
problems
with this coding style.
      </pre>
    </blockquote>
    <pre wrap="">As time goes on, I'm becoming a bigger fan of inlineCallbacks.

Too much serialization, even accidental serialization, trades 
comprehensibility for performance.  I think that's a reasonable place to 
start: make your system easy to understand, then make it fast once you 
know what's going on.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
How does the saying go? "Premature optimisation is the root of all
evil"?

As an intermediate novice, I find inlineCallbacks to be a great way to
make code look more like sequential code, but with many of the benefits
of asynchrony. You can then refactor the code to make pieces even more
asynchronous where it's useful, but keep the sequential parts where that
makes sense. This is great from a 'learning twisted' point of view.</pre>
</blockquote>
My biggest reason for using frameworks like Twisted, is that they make
it easier to implement network applications.<br>
<br>
Serial programming works well when the tasks are simple, and errors are
not considered.<br>
As soon as error/timeouts/corner cases are considered, your nice simple
serial code is more complex and much slower than the "more complex"
Twisted code.<br>
<br>
This is why people do not always see the immediate need for
asynchronous programming.&nbsp; If inline callbacks offer a way to ease
yourself in to Twisted, or make your program more understandable to
others, then it is worth using.<br>
<br>
BTW,&nbsp; maybe this workflow could be used for a Twisted presentation.&nbsp;
Take an existing program and turn it into a Twisted program.<br>
<br>
Carl<br>
<a class="moz-txt-link-abbreviated" href="mailto:zmola@acm.org">zmola@acm.org</a><br>
<br>
Carl<br>
</body>
</html>