[Twisted-web] Twisted vs Webware
Clark C. Evans
cce at clarkevans.com
Fri Oct 22 19:40:28 MDT 2004
On Fri, Oct 22, 2004 at 12:55:31PM -0700, Tom Fillmore wrote:
| I have a couple on the drawing board - one will be a _very_ data
| intensive app for commercial real estate, while the other will be a
| front end to a text search engine for various types of
| text/writings, with PDF output, etc.
It sounds like you have some pretty traditional requirements -- both
Twisted or Webware will work for you well. I was using Webware about
2-3 years ago, so I can't tell you what is new since then, but I've
switched to Twisted and have been very happy. Perhaps if I explained
why I switched, it might be helpful.
First, I wanted a built-in web server, I got tired of configuring
Apache separately and at the time Webware didn't have its own HTTPS
server implementation. I've been using Twisted's HTTPS for some
time now and have been very happy; just recently I've written digest
authentication for Twisted -- its in my sandbox if you wish.
Second, I wanted 'ftp' server support "built-in" since many
operating systems allow these to be mounted and used just like file
systems. This seemed quite a useful feature, and when I saw a
built-in 'smtp' implementation I got a fuzzy feeling inside.
Third, when I first started to play with Twisted, I really loved how
it handled resources. Webware has 'page' objects, whil Twisted's
resource is similar, it is more flexible and since I was writing a
very serious HTTP URL based system I needed quite a bit of
flexibility in how my system should handle URLs. For Webware I was
maintaining a series of patches -- with Twisted I didn't need the
patches and this made me very happy.
Fourth, Twisted uses 4-space indentation, usually at 76 columns,
and if it isn't, they don't mind me patching it so that it does
fit on my 80-column-huge-font-for-blind-people-screen. By
contrast, Webware used tabs mixed with eight-space-indents that
often put their source code at 159 columns and out. This may seem
nit-picky, but when you have to read the source code to really
"grok" what is going on... having to squint sucks.
Fifth, I actually dislike threads, and to my suprise, people here
had the same opinion. Twisted's deferreds take some time getting
use to, but once you do they are simple and powerful.
Probably the major difference is scope. Twisted is very large
framework and growing. It is a application framework plus all
of the lower-level guts you need. Webware, on the other hand,
was small and focused application layer that used Apache and
didn't try to do everything. If you want to hammer out a quick
application -- perhaps Webware may be better.
That said... if you go with twisted, you may want to hang out
on IRC to get to know people some.
More information about the Twisted-web