[Twisted-Python] Soon to be not-a-newbie?
nitro at dr-code.org
Fri Jan 25 17:42:41 EST 2008
Am 25.01.2008, 21:26 Uhr, schrieb Simon Pickles <sipickles at hotmail.com>:
> No you need a totally different set of classes which don't follow any
> similar pattern to the first, probably have very inaccessible (ie,
> forgettable) names. In this case you need to connect an A to a B to a C
> with a D and E as params, and F as a callback and inherit from a WIDGET!
> aaaargh! :)
This is exactly how I perceive learning twisted! It consists of a bunch of
high-level abstractions which aren't explained properly in any how-to
article. Now if you want to customize things you have to start looking
around the twisted code and make your way from there. At this point you
realize that there are at least 10 different parts somehow interacting
with each other and you have no idea where you are supposed to plug your
own stuff in. Sometimes twisted is a bit too twisted for me.
I am missing a quick overview about the high level concepts used in
twisted such as Protocols, Factories, Reactors, Transports, etc and their
interaction. Reference docs are not counting here, because you can't
expect someone evaluating twisted to skim through the whole thing and
gather everything piece by piece.
The user should maybe be instructed *how* to learn twisted, not be shown
only an example. For reference, I just took a look at the finger tutorial.
I like it's hands-on approach. However, already in the 2nd part the user
is given a huge bunch of code:
. He doesn't get any hint how to write that themselves. When do I subclass
X to do Y? Which methods can I override?
Of course there are interfaces which should tell the user about some of
those things. After all one of the main goals of interfaces is
documentation. Again, the user is not given a quick introduction why and
how twisted makes use of interfaces and how he can exploit this. It would
also be handy to have a reference chart which shows typical tasks along
with a pointer to documentation which might be helpful and/or related.
>>> ... but if you persevere, its great! You just have to leave part of
>>> your brain behind in a field in hampshire :)
I agree, twisted is very powerful even if you don't realize it always,
because it seems to hide behind all those abstractions which are not
>> the recent spate of inlineCallbacks-related posts alarms me.
Why? Using inlineCallbacks just helps writing convenient syntax utilizing
deferreds. If you ever wrote code which uses lots of deferreds, you know
that the code is (visually) lacking a decent structure. It's just not the
way you think and makes things hard to read. inlineCallbacks just turns
this into a nice, linear piece of code again (linear not to be confused
More information about the Twisted-Python