[Twisted-Python] My review of Abe's book "Twisted Network Programming Essentials"
Hi. I just finished a review of the new O'Reilly book on Twisted, by Abe Fettig (hi Abe!), and thought you all might be interested in it: http://tv.debian.net/articles/review-snakeball/
Tommi Virtanen wrote:
Hi. I just finished a review of the new O'Reilly book on Twisted, by Abe Fettig (hi Abe!), and thought you all might be interested in it:
Wow, Tommi, thanks for the very thorough review. I'm seriously impressed. You picked up on a lot of details I'd missed, especially the places where I didn't follow best practices in the code examples. I'll get these incorporated into the official errata. And next time I'm definitely going to have you involved as an official tech reviewer. You have a talent for it. Overally I think you're accurate in pointing out the weaknesses of TNPE. There are a couple of points that I'll push back on, though: 1. "DO NOT BUY TNPE TO LEARN TO WRITE WEB APPS" Sigh. Writing the chapter on web servers was extremely frustrating. For years now Twisted web app developers have had two choices: use stable APIs that are widely considered to be broken and/or deprecated, or use new, improved APIs that are currently under heavy development and unstable. I put off writing this chapter for as long as possible, hoping that there'd be a stable release of twisted.web2 to write about, but it didn't happen. So in the end I decided it was better to document the current stable twisted.web code, for all its faults, than to try to document APIs that were in flux and very likely to change. Hopefully readers will understand that this chapter is explaining how to use the current twisted.web, not teaching the ideal architecture for web applications. On page 54 it says "The classes in twisted.web.resource and twisted.web.server are, as of this writing, widely considered to be past their prime. They have some serious shortcomings ... Both are scheduled to be deprecated in the future in favor of improved classes provided by a next-generation web package known as twisted.web2." It also says that if you're building a major web appication you should use Nevow. In retrospect, it probably would have been best to do both: include examples of the stable APIs, but write more about nevow and twisted.web2, including some examples. 2. It's not a Twisted Bible. This is certainly true. If you look at the oreilly.com page [1] you'll see that this book is in the "Developer's Notebook" series (http://devnotebooks.oreilly.com/). Here's how O'Reilly describes developer's notebooks: "A Developer's Notebook is just what it claims to be--the often frantic scribbling and notes that a true-blue alpha geek makes when working with a new language, API, or project. It's the no-nonsense code that solves problems, stripped of page-filling commentary that can often serve as more of a paperweight than an epiphany. It's hackery, focused not on what's nifty or might be fun if you've got some spare time, but what you need to simply make it work now. This isn't a lecture, folks; it's a lab." TNPE was written as a developer's notebook, and it shows. Unfortunately as I was getting close to finishing the book O'Reilly decided that the developer's notebook line wasn't doing very well and that they'd scrap the "notebook" design and naming convention in favor of the more familar animal book. I was happy to get a cool animal book cover, and my editor and I tried to pick a title that accurately portrayed the contents of the book. But in hindsight I think it would have been better to keep the developer's notebook name and design. When some people see an animal book they think "definitive guide", and then they're disappointed when it's something else. I hope that at least clarifies those points. This was my first book, and I'm proud of it, but at the same time I'm sure I have a lot to learn. Probably it's a lot like writing code, and somebody I'll look back on it and be able to see clearly all the things I did wrong :-). In any case, thanks for taking the time to read it and write this! Abe [1] http://www.oreilly.com/catalog/twistedadn/ (you can see traces of the original "twisted - a developer's notebook" title in the URL)
Abe Fettig wrote:
1. "DO NOT BUY TNPE TO LEARN TO WRITE WEB APPS"
Sigh. Writing the chapter on web servers was extremely frustrating. For years now Twisted web app developers have had two choices: use stable APIs that are widely considered to be broken and/or deprecated, or use new, improved APIs that are currently under heavy development and unstable. I put off writing this chapter for as long as possible, hoping that there'd be a stable release of twisted.web2 to write about, but it didn't happen. So in the end I decided it was better to document the current stable twisted.web code, for all its faults, than to try to document APIs that were in flux and very likely to change.
I understand you very well. Personally, I would probably have skipped most of the server-side web chapter, maybe talking only about the proxy and perhaps show things like static.File. Or maybe I would have just dropped the whole chapter. I'm 100% with you here, this is a difficult time for web development. I got seriously burned with the whole Woven thing. Besides, Woven was a better name than Nevow (*cough* *cough* ;) Hopefully there will be a time when we have t.web2, with a rendering-only Nevow on top of it, and there will be a usable liveevil^Wlivepage^Wathena^Wwhatever, and maybe nufox, etc.. and then, maybe then, there will be a book about all that. There's definitely enough material in web apps to fill a book, and I happen to have a decent plan for one, if I ever find the time and motivation..
2. It's not a Twisted Bible.
TNPE was written as a developer's notebook, and it shows. Unfortunately
Oh, don't get me wrong. There's nothing _wrong_ in it not being the Twisted Bible -- in fact, I think Twisted is still to young and fast-moving to really be ready for a Bible. I'm just trying to make people know what they are going to buy.
I hope that at least clarifies those points. This was my first book, and I'm proud of it, but at the same time I'm sure I have a lot to learn.
You _should_ be proud of it, it's a good book, and on a subject that definitely needed a book out. Good work.
I'm 100% with you here, this is a difficult time for web development. I got seriously burned with the whole Woven thing. Besides, Woven was a better name than Nevow (*cough* *cough* ;)
Heh, how true. In 2003 I started introducing Twisted at work, and after struggling for a while with forms handling in Woven, I threw in the towel and transplanted Quixote's PTLs and form widgets into Twisted. Someday I hope being able to gradually switch the whole mess to Nevow, but not before the rate of change of forms handling and superAJAX stuff has slowed significantly. -- Nicola Larosa - nico@tekNico.net On a personal note, Xara is the main reason why I still haven't switched to a Linux desktop for myself. I can't live without my Xara... now it looks like I'll finally be able to switch! Tonight, I will literally go out and toast to Xara. This is the best news I've had in months. -- GooseKirk on Slashdot, October 2005
On Wed, 30 Nov 2005 11:09:45 +0100, Nicola Larosa <nico@teknico.net> wrote:
Someday I hope being able to gradually switch the whole mess to Nevow, but not before the rate of change of forms handling and superAJAX stuff has slowed significantly.
Yep. I predict that will be happening soon - as soon as we manage to fix the athena/FF15 bugs and do some more testing with IE, as well as come up with a lightweight forms thing for use with athena. However, Nevow is still definitely not yet for the risk-averse. I wouldn't recommend using it until both the aforementioned work has happened, it has been ported to web2, web2 has been released, and the 'context' argument has been eliminated from Nevow as well as it has been from web2. I did not envy Abe the work of writing that chapter :).
participants (4)
-
Abe Fettig
-
glyph@divmod.com
-
Nicola Larosa
-
Tommi Virtanen