Wednesday, February 29, 2012

PyCon on The Charles: Night 2

We had the 2nd night of PyCon rehearsals tonight at the Boston Python Meetup and it was my turn to practice. My PyCon talk is Stop Writing Classes. The talk presents some examples of code that were overly complicated and how I refactored or avoided them completely. Five years ago I couldn't have given this talk because it would have been just a spleen cleaning list of things I found icky but couldn't describe. After many years of forcing myself to write constructive things in code reviews I know better why those things are icky.

I was supposed to go first but there were, of course, A/V problems[1]. I've used that same laptop in the same room before but this time - no dice. Anytime I changed slides the sound would blurp static and the picture would drop; I got a curious tingling in my hand when I power cycled the machine. Then I was supposed to go second and this time I plugged the laptop into the same ground as the projector - still no dice. Last and finally I was supposed to go third: this time with my slides (they're HTML!) on Ned's laptop which had faithfully delivered his own talk (in HTML!) Pragmatic Unicode, or, How do I stop the pain?. No. Fucking. Dice. But then he restarted his laptop a couple times and it was gravy from then on.

The official format for the event is that speakers will deliver their talk as-prepared for PyCon. For speakers that feel most comfortable delivering their talks as-prepared this is very useful rule (Ned is a beautiful fscking machine at delivering his talks as planned). For speakers that deliver their talks more ad-hockily the official format is weakened or ignored; last week Glyph gave his first best guess as a talk, and this week..

To say I spent little prep time on my talk would be unfair. To say I spent just 4 hours reformatting my research notes into a talk would be completely fair. As it usually happens I presented my notes as a talk while speaking extemporaneously [first drafts happen].

I panicked a bit when I had gone through 16/20 slides in *only ten minutes*. I had four slides left [two of which I knew I didn't really like] and fifteen minutes to fill. Two minutes a slide is a pretty good rule-of-thumb and I'd completely blown it. At this point I told all the stories about the first 75% of the slides (many of those stories were about redemption) and then reiterated a dozen times in a dozen ways why simpler things were both simpler and better. The laughs and nods were contagious and I hit my 25 minutes.

So, as in past years of dress rehearsals I learned something. And now I will get on with the usual thing of compulsively rehearsing and rewriting the talk until it is good enough that I think it won't be wasting other people's time. 40+ hours of rehersals and rewrites. Mostly because I love you guys and partly because I don't want to suck.

[1] There was a guy who complained that the A/V problems were easily avoided and as such were cutting into his personal time (his personal time attending an event with free talks, free pizza, and free beer). Multiple people reminded him that volunteers shall not be questioned[2], and many more people privately offered that they would drop the guy if he complained twice[3].
[2] Ned & Jessica.
[3] Oh, everybody but him.

Friday, December 23, 2011


The Talk schedule has been published and I'm on it. For which I'm very greatful - I saw the full list of ~400 submissions and there were many I'd like to see which didn't make the cut. [To all those people I'll let you in on a secret: submit the same thing at a smaller conference. They have 80%+ acceptance rates - basically they just toss out the crazies and let everyone else speak. PyCon was like that not too long ago. So go and speak wherever they will have you and get some practice: my first PyCon talk never would have been accepted under today's standards.]

Name Dropping

Normally I'm a Hallway Track kind of guy but there are some talks from friends I kinda want to see as it happens as an event: Larry Hastings, Doug Hellman, Jeff Rush, Benjamin Peterson (is he old enough to drink yet?), David Mertz, Moshe Zadka (long time/first time?), Ned Batchelder, Alex Martelli, Barry Warsaw, Dino Viehland, Maciej/Gaynor/Rigo (pypy), Armin Ronacher, Glyph (I'll tell you his real name in trade for a beer), Raymond Hettinger, Gary Bernhardt, and Jim Baker.

And that's just the list of speakers I know will be good, there are many more that look good on paper that I want to see.

You'd better nail it kid

There are some perennial talk topics because it is always nice to have a fresh take on important things. That said, being the second (or third, or fourth) person to retread the same ground is difficult.

Larry Hastings is treading old ground with Stepping through CPython, a tour of what really happens when your python code runs. I did it in 2006 as "Writing your own python types in C" and Ned Batchelder did it much better in 2009 as "A Whirlwind Excursion Through Python in C". I'm looking forward to Larry's take.

Getting the most out of Python imports by Eric Snow. Note that he speaking about imports and his name isn't Brett Cannon.

The Magic of Metaprogramming by Jeff Rush and Metaclasses by Luke Sneeringer. Not just well tread ground, but ground always loaded with fresh landmines.

Decorators and Context Managers by Dave Brondsema. I'm very much looking forward to this one, as those things have been my topics in the last few years. I haven't met Dave but I imagine he has giant brass balls.

And the other thing

Raymond Hettinger will be presenting The Art of Subclassing and I will be presenting Stop Writing Classes. Raymond and I have agreed on pretty much everything in the decade I've been involved with python (he was already a commiter when I showed up*). I doubt we are in disagreement about classes or subclassing, rather we are giving talks about two different topics. His is "here is how you do hard things well" and mine is "don't do hard things, they are hard and you'll probably fuck it up". Two weeks ago I wrote a caching class that used __new__ and this past week I refactored it to not do that; the code was half the length and achieved the same result. My only question to the team was "why did no one yell at me two weeks ago?"

* My favorite PyCon story is my first one: 2003 in DC and I got to meet everyone that was previously just names on a mailing list. Hettinger was working the registration desk and I was like "thats neat" and when I stepped out into the smoker's lounge I introduced myself to the three hangers about. "Hi, I'm Jack Diederich" was followed by "Hi, I'm (Alex Martelli|Tim Peters|Christian Tismer)". That was awesome.

Monday, July 11, 2011

Analog Analogies

At work there has been a recent interest in explaining tech things in terms non-tech people can understand. Not just because it helps explain tech things to non-tech people but because it also clarifies to tech people what the purpose of the thing is.

We hit on the term "analog analogies" because one of my coworkers kept saying "analog" instead of "analogy" and I didn't think of the two terms as synonymous. I thought of "analog" as opposite "digital", but not for a second did I think "analogue" was synonymous with "analog" (it is). Hence the redundancy. So "analog analogies" became the phrase meaning "explaining a digital thing by analogy."

By way of for example[1] I'll be leading off my five minutes at the Q3 kickoff with one of my favorite analog analogies: the high and low laundry equilibriums. There are only two stable equalibriums in laundry: you can keep all your clothes clean and do laundry every time you have a basket of dirty, or you can have a full clothes hamper and only do a load when you need something to wear.

It is a not terrible analogy for technical debt. But the analogy falls down because even in a medium sized project you might have several different laundry equilibriums across different aspects: are we keeping a lid on our code bottlenecks? backend queries? can we rent/buy faster machines? And the worst part is you might not know which is lacking. I think the Germans have a word for how you know: messerschitz. You gotta do that too.

[1] I like to pretend to be all Dutchy on occasion.

Sunday, June 5, 2011

MUD Nostalgia

For programmers of a certain age - those who saw their first internet connection in the 90s - MUDs [Multi User Dungeons - basically D&D online] were de rigueur. Open Source was in its infancy and this new thing called linux came on a stack of 35 3.5" floppy disks (configuration was equally hostile). So if you wanted to contribute to a collaborative project MUDs were where it was at. A number of python people have outed themselves as [ex?]mudders, including Glyph (Twisted founder, Twisted started as a mudlib), Doug Napoleone (PSF board), Jesse Noller (PSF board), Richard Tew (Stackless Python), Will Kahn-Greene (Miro, and mud client Lyntin), and yours truly (I maintain telnetlib, need I say more?).

Learning is in the doing, so what I got of college was mostly lots of free time to do stuff. I spent maybe 400 hours in four years doing programming for classwork and over 4000 hours writing LPC code for a now defunt MUD* (using /bin/ed - the only supported editor). Writing a mudlib was my "turtles all the way down" moment, when it clicked that user level programs were just programs that were composited from other programs; The trick was that the lower level stuff had an agreed upon naming convention but otherwise wasn't special at all.

I'll admit to being somewhat jealous of the college students of today - it is easy to contribute to projects that actually matter. Being able to rely on ping times being under 500ms is nice too (Europe used to just _go away_, sometimes for days).

I haven't left MUDing completely behind. I still use it to try out new methodologies in coding and just play around in general. Leanlyn ( is my Lyntin fork that is about 10 years old and will never be finished (or be less than user hostile).

* The dead mud was Ether Realms. I can still be found sometimes at OverDrive (a Lehigh staple) and Three Kingdoms.
** College came with lots and lots of free time. I spent way more than 4000 hours just chasing tail. Imagine me but with shoulder length hair, an eyebrow ring, and a flannel shirt (it was the 90s)

Wednesday, March 16, 2011

PyCon Speaking

Do read Moshe's How to give an OK talk, esp the Narrative part. It feels quite silly to repeat yourself on every slide but you are preforming live and not writing on paper - so tell the audience why slide N+1 is important and for the same reason as slide N at every opportunity. During my talk I felt as though I was being overly repetitive, but on watching it after the fact I feel like I didn't hammer home the point enough (you should do more shit like this!).

Speaking of speaking: I asked a few popular conference warriors (Martelli & Hettinger) how many talks they had given and when they first felt comfy giving talks. They didn't know. I should have asked Beazely and C.T. Brown but they're professors and get more practice in a year than most people get in a lifetime.

But seriously, those popular conference regulars didn't know. Hettinger estimated he had spoken 30 times. His wife then pointed out he did 15 talks last year and so he upped his estimate to "more than 15 twice." Martelli estimated 50-100 talks but was equally uncertain. Myself, I've only done 7-8 and still get nervous if the room is less than 30 or more than 300 people. Hettinger said something like "I still get nervy when it the audience is 10x what I'm used to." I couldn't coax an admission out of Alex (I had only vague thoughts on the topic when I asked, and no narrative).

Take it all as paraphrased hearsay, but anytime I have to step up to a podium I just say to myself "suck it up, princess." It mostly works.

Saturday, March 12, 2011

PyCon Detritus

PyCon proper is over and sprints have begun.

Language Summit

The Summit was boring again this year, and this is good. The language moratorium is over so PEP 380 ("yield from") is moving forward. The stdlib will get its own repository so it can be shared between CPython/Jython/IronPython/PyPy. Likewise all the commiters from the not-CPython projects will have commit privs to CPython (most already do).

My Talk

Useful Namespaces: Decorators and Context Managers went over well: video available here and here's the live Convore thread from the talk.

Every year I say I'm not going to do another talk, but it is years like this that make it worthwhile. Dozens of people I don't know have offered me thanks, jobs, free beer, and ZJs. There is no worse feeling than spending 40 hours on something and having it be less than good. I'm a happy camper.

The first question was asked by Larry Hastings ; it's become an inside joke because Larry has asked the first question at ALL my past PyCon talks (having a confederate to break the ice on questions is handy). I zinged him a bit in my response ("thank you for pointing that out, and may I point out it's just an example slide"); apparently most people thought I was razzing a random questioner even though I was addressing him by name.

Another questioner objected to my use of a module named "UnicodeNazi" because it isn't nice to talk about Nazis even (or especially) jokingly. I restated his objection and said he should take it up with the module's maintainer. That maintainer is Austrian, natch.

The room was pretty full. Not going out the night before definitely helped my delivery. There were some A/V problems at the start (lots of those this year) so I rushed the last few slides. Better that than running short though.

Other People's Talks

So far, so good. Yesterday my talk was in the afternoon so I spent all day preparing and didn't make any talks. Today I went to three: Alex Gaynor's "Python's Data Structures," Larry Hasting's "The Python That Wasn't," and Richard Saunder's "Everything You Wanted to Know About Pickling..." Most of my time was consumed by the Hallway track.


The hotel has banned alcohol (or at least implied a ban) in public spaces that is not purchased from the hotel. I don't know if this is because of money or just because they want fewer drunks walking around. Annoying either way.


A woman came up to me and said that something I told her last year had stuck with her. Last year she was sitting at a table with myself and another core dev, and holding her own when discussing eldrich corners of Python. The topic turned to contributing to open source and she had a list of reasons she felt she couldn't contribute, none of them very good. The good news is that she sprinted remotely last year, is sprinting in person this year, and has contributed code to projects over the past year. Oh, and the thing I said that stuck with her? "Suck it up, princess." So I have struck a blow both for and against diversity. [FYI, I don't remember saying that but it is the kind of thing I might say after a few beers]

Saturday, February 26, 2011

Happy PyCon to Everyone

I'm in the happy majority of Python commiters that mostly idle except for the scheduled holidays like bug weekends and release alphas, and only awake for the high holidays like PyCon. I'll be speaking again this year and I'll be there for the language summit before and two days of sprinting afterward.

This weekend I stopped researching my talk "Useful Namespaces" and started actually writing slides; the theme is a riff on "Namespaces are one honking great idea -- let's do more of those!" and the first slide is "I monkey patch the shit out of everything." Coincidentally I won't be sprinting 100% on core stdlib this year but will instead be trying to fix up my monkey patches and tests on other projects that haven't yet made it upstream.