Tuesday, September 08, 2009

Django Conference (Day 1)

I'm in the great hall, registered with T-shirt. @psf_snake is still in her FedEx container, to join us later. At least she's able to tweet. They've done a good job providing power strips here. So many hotels aren't set up for one laptop per adult (OLPA).

Speaking of which, I'd hoped to be lugging my new 2.6 lbs Ubuntu Starling, a replacement for the Dell that died, but after first picking mode of delivery (paid extra for 3-day), I then got notification it takes up to seven business days to run orders through manufacturing (nothing "just in time"). So I don't have the sexiest of accessories. At least I've got my high heels (and Olympus Stylus). Need coffee...

This is a friendly mostly-guy world. I was offered a free pastry, met Travis in line for coffee. He's fresh from Kansas, the Django capital. The Django pony is here, more like a unicorn, all pink and adorable. Are our totems both shes then? More gender studies ahead. Most of us are from out of town, camped out here at DoubleTree. I introduce myself as the local guy, say "Welcome to Portland" quite a bit.

Fake JKM (a quick keynote): James Konrad Tauber (JKT) is "impersonating" JKM (Jacob Kaplan-Moss). Russell Keith-Magee... RKM JKM JKT... it's The DaJango Code, flash to book cover (JK... MT... so many riddles). MT = Malcom Tredinnick (Cornwall, UK). Simon Wilison is allegedly the original inspiration for JKR's Harry Potter, the K taken to comply with the code. TMR is Tom M. Riddle (Voldemort). Obviously a conspiracy and yeah that KKK down the middle is disturbing, probably just means "Kansas on steroids" (note to diversity@python.org: maybe check poet Gene Fowler's "e pronoun"? -- I'm having trouble googling anything on it (math-teach is down again)).

Avi (@avibryant) is now taking the podium.

Avi is from Smalltalk (.st) and Dabble DB worlds. Seaside web framework? Never heard of it. Trendly: another product he's plugging. The theme here is obsolete systems, a theme for me too (I was poking fun at MUMPS while in line with Travis (he'd never heard of it)).

Primo Levi story: we didn't need the onions anymore (as a metrological tool for testing varnish, a kind of thermometer). Lots of "onions" left over from CGI days.

Yes, we're aware of ~SQL e.g. Cassandra (Facebook), these key:value and map:reduce machines. Yes, web frameworks "of the future" will back end into these too. This jibes with my idea of the legal medical record as more like a Facebook scroll, medical instruments leaving signed results, applications harvesting what they know to look for.

If your entire dataset fits into 600 Meg, just put it in RAM (duh). Affordable RAM changes the dynamics. It's the "database wars" (finding the right tool for any given job). Persistence doesn't have to mean SQL, we've all learned that by now.

Concurrency is the other thing to keep thinking about (yay, dimming the lights, about time). The GIL is not a big deal. He's going with what I call the "snakes on a plane" model, i.e. many separate Pythons doing their thing, ala the plain vanilla buzzbot design (thinking of Patrick's architecture).

Gmail is prototypical of tomorrows applications in providing all the HTML and Javascript up front, then just sending JSON snippets back and forth. This isn't about being swoopy (glitzy) so much as making the browser the puppet theater, pulling strings with jQuery etc. The JavaScript VMs have gotten so much better, e.g. V8 in Chrome.

Incremental updates means more behind-the-scenes gnarly URLs, a kind of lower level conversation between a client back door and the server. Django URL routing might become less pretty? Google's GWT is probably the only framework taking this challenge head-on. However Avi sees going to smelly Java (from JavaScript) as something of a step backward, even if strategically justifiable.

I recall Alan Kay's being excited about JavaScript at our London summit, thinking it has a bright future (he'd done a turtle graphics demo to amuse himself while recovering from a back injury). His prognostications have borne out. Portland's Admirers of JavaScript would appreciate this talk. Avi has developed a Smalltalk development environment internal to the browser that translates to JavaScript under the hood. Could Python do something similar?

Ur Doin It Wrong by James Bennett: RTFM. "Help! I don't know Python" is the other big problem. How do I do X in Django is often really a Python question. Do the tutorial, get a couple books, read Python module of the week. You need to know about PYTHONPATH, super(), closures, decorators... know how to read error messages. Read bit.ly/reusable-django-apps/.

Django really is just Python, not some language on top of Python. Main beef: Django does not make you use the default components. Learn how to swap in the components you need. It's just Python. Wanna point Django at Twisted ala LeafyChat? Go for it.

If you're distributing Django applications, follow packaging guidelines. Advice: steer clear of setuptools for now, stick with distutils (need a README, /docs, license.txt etc.). Use Sphinx for docs.

James likes MIT, BSD licenses over GPL, which "might as well be proprietary" the way he looks at it. Have unit tests. Use django-lint, pep8.py and pylint. pypants is a fun implementation of some of this.

We have a Perl guy now, Frank Wiles. This is a good complement to our Smalltalker keynote -- proves the Python community is not just a buncha KKK-style language bigots.

Frank is addicted to Django and not ashamed to admit it. Django is his "gateway drug" (this is a pep talk). Frank is from Revsys, part of the Kansas-based Django cartel, has been with the project almost since its inception.

The difference between good code and bad is "WTFs per minute" upon code review. zc.buildout, django-admin.py -- nothing as clean and nice in Perl world. Testing setup much easier -- saves so much time, nicer hangover, the high is better... (check out the slides). "My hands don't hurt anymore..." (less shift key, than in Perl). You've gotta love your tools, is the basic message.