When Great Features Aren’t Enough: Twisted, Tornado, the Zero-Step, and Activation Energy

Fresh on the heels of Tornado’s release, and Glyph’s response to it (note 1) and others, I’ve been thinking about why Tornado so excites me.

Twisted is a robust, powerful, scalable asynchronous web framework (among other things). We have used it successfully in the past. Taking them at their word, Tornado is scalable, but focused on http and much less fully featured than Twisted, it does provide authentication pieces (awesome!), and some other utilities.  In architectural terms, Glyph is probably right that Tornado is incomplete (to be polite).

I still want to use Tornado.

I would much rather use “best in class” tools always, but sometimes the activation energy is just too high. In using any piece of software there is a Zero-Step (or 0-step), where I have to be convinced to try it.  Tornado does an excellent job of convincing me.

Great Features Aren’t Enough

Look at the Dyson Airblade. The narrative is simple.

  1. Hands Go In
  2. Hands Get Dry
  3. Full Win

dyson

Now the Airblade is one of those rare items that actually delivers on its promise.  It ACTUALLY DRIES YOUR HANDS, unlike most hand dryers.

Capability is not enough.   If I’d never seen one in action in person, I’d have been slightly unhappy about my perennially soggy hands, but life goes one, and that’s why the gods invented pants and skirts.  Now I pine for an Airblade whenever I’m in some public bathroom without one.   The win doesn’t come from how well it works, but from how moron-proof it is.

The Zero-Step Matters

Trivial applications should be trivial to write.  Of course, asynchronous web-serving isn’t trivial at all, but it should look trivial, because the dev shouldn’t have to care how it’s implemented (until they do, but not one second before).  I’m not smart enough to write a good dict implementation either, but no one makes me go through hoops to use the excellent one that comes with Python.

The “hello,world” in Tornado is a dozen lines,  and looks very similar to the one in web.py, except that it inherits from an asynchronous class base instead of object or a PYPO (a plain old Python Object). This simple “hello, world” code is the featured content on the main page of their respective sites.  What is more inviting than that?  It screams, you can do this too.  Low activation energy empowers the user. Before a user can be a power user / evangelist, they have to start as a regular user.   For many people, Tornado will solve their problems well enough.

If twisted can do this (through some sane default web classes, decorators, etc. (Note 2) ), then point it out right on the front page. Perception matters, and having a prominent snippet, saying “YOU CAN WRITE IN TWISTED, and IT’S SIMPLE, here’s how”, is more important than some of the posted news, for example (Note 3).  It may all be there, and build already, but it’s not obvious to me, and not everyone has the patience to dig.

By contrast, when I learned Twisted, I felt like I needed to understand it holistically.  Nothing made sense, which was frustrating, then after a while, it all did, and I grokked in fullness.   Until then, it was blood and gore.  My goal wasn’t to understand Twisted, it was to get an asynchronous app going.  That impedance mismatch affects uptake, mindshare, and adoption.  That’s the 0-step, and the 0-Step matters.

Make The Easy Easy, and the Hard Possible

There is nothing new in this essay, except the weakly retouched photo of the Airblade.  Good usability is hard, and that’s all we’re talking about here.  Removing barriers to entry is part of it.

Don’t make me choose between simple tools for simple projects, and complex tools for complex projects if I don’t have to.

  • Create default modes / deployments that handle the usual cases
  • make “first steps” and “hello worlds” prominent on your project pages
  • most tools in the real world don’t require a person to fully understand the tech before using it.
  • aim for a ‘ramp-up’, where as one needs more functionality, one has to do more research, but not before
  • Twisted gets the “hard” end right. Make the easy end easy!

Continue to “make the easy easy, and the hard possible”, and this world will iterate towards the best of all possible worlds (Note 4)

——————

note1:  Glyph, if you’re reading this, I really don’t mean to be a prick about this stuff, and I can understand why it might be very sensitive, given the amount of work you’ve put into Twisted. So please understand this as coming from a place of wanting Twisted to be more awesome.  I want to use Twisted, even in small projects.  I’ll like it to be core of whatever framework I use.  Make it easy for me to do so!  Make it shiny.  Make it zero-barrier-to-entry.

note2:  SQLAlchemy is similarly complex (from a “scope of task”) standpoint to Twisted.  Maybe something like Declarative for Twisted would be a goodness.  I think I want an asynchronous-http mix-in basically :).

note3:  More egregious example:  the Clojure site, which seems to be much more focused on explaining how Clojure relates to other LISPs and Java than actually attracting outsiders.    I had a long discussion on SO about Clojure’s presentation layer with one of its evangelists (Rayne).  I’m not sure who comes off worse.  He accuses me of needing to be spoonfed.  I prefer to think that laziness is a virtue.  And who doesn’t want to be spoonfed!

note4:  FWIW, Dustin Sallings’ ‘Snake Tornado’ looks like a great start/compromise, and exactly the kind of project I like to see.

About these ads

8 Comments on “When Great Features Aren’t Enough: Twisted, Tornado, the Zero-Step, and Activation Energy”

  1. Glyph says:

    Gregg,

    You don’t need to convince me.

    You just need to *do it*! :)

    Do you want wiki edit permission on twistedmatrix.com? Do you have some doc patches to submit? Many of the easy use-cases already are easy, and it’s just a matter of highlighting them. For example, the Twisted TCP echo server implementation fits into a tweet.

  2. Good god, man. Lay off the formatting. Italicizing and emboldening every other phrase isn’t going to make this rant any more meaningful.

    It saddens me that more and more people talk like technology columnists or evangelists / marketers. It’s the Great Kawasakization of the Internet, and it sucks.

  3. Alex Dedul says:

    Nice article, thank you..

  4. I’ve run into the “spoonfed” issue in a variety of places. In the case of Clojure, I did manage to track down some good “get your feet wet” stuff once, but I don’t recall how much it relied on my familiarity with Lisp.

    For the Factor programming language, they had good intro material buried in their wiki, but their home-page used to assume you’d like to just dive right into the API references. (I think they’ve fixed that now.)

    Trying to figure out how to use some of the Java packages (like rendering table cells in Swing) was like that for a long time. “Here’s a heap of barely connected classes. You were there when we thought of them, right?”

    I am just wandering about now. I felt I had an end in sight when I set out. Now, I’ve lost track of it. I feel I might flip a coin and get “heads” two-hundred times in a row.

  5. [...] player in Tornado’s space, where apparently an amusing-but-unproductive religious war has sprung [...]

  6. I recently inherited a an early stage webapp prototype in Tornado, and I’ve got to say that it is a nice little web server. I think people make a big deal about it’s async nature, but don’t really talk about its’ completeness as a web server. All the basic stuff you need to create a web app is there without the unnecessary “free” code generated stuff you get from larger frameworks. It’s performant, dependency-free and has some nice touches like builtin authentication, cross site request forgery protection, simple, yet powerful templates which use python as the templating language and autoreload to avoid restarting to get changes.

    I think the more common use case for Tornado is to replace CherryPy, not Twisted. The fact that it can scale up to many connections is just a welcome bonus when (if) it happens.

  7. [...] Which is a really good argument. And yet, I find myself in the Tornado camp anyway – for the reasons outlined here. Tornado is faster and easier to learn, and yes, the “easier-to-learn” part matters A [...]

  8. Cyclone.io ticks all the boxes – easy as tornado for zero step and uses twisted as underlying networking layer.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.