Friday, March 25, 2005

PyCon and SD

I think it's been years since I've given a talk that was less than 45 minutes or an hour. Everyone except the keynote speakers at PyCon had 1/2 hour. Naturally I had too much material and had to blaze past the slides at the end. Many people were very kind and told me they had enjoyed the talk but it felt unresolved to me. All the talks were both recorded and videotaped, and so eventually you should be able to hear or see it and decide for yourself -- not just my talk, but the entire conference! (The actual distribution strategy has not yet been devised, so you should watch the website).

It was again interesting to experience and contrast the SD conference with PyCon.

SD is best described as a teaching conference. There are half-day and full-day pre-conference tutorials, and during the conference all the talks are 1.5 hours long (I created both the C++ and Java tracks for the SD conference and chaired them for many years, and so I helped evolve this structure). All the subjects are intended to be well-established on the acceptance curve; this is a commercial conference and they want each topic to have a strong draw. SD is a good place to go in order to develop expertise, almost as if it were a multi-subject professional development seminar.

PyCon is a community conference. It is actually developed and organized by volunteers from the Python community, and any profits go into the Python Software Foundation (PSF), which promotes the language and lately has even begun to give grants for the development of various aspects of Python (a recent grant was to update Jython, for example). PyCon is thus much more edgy and experimental and this adds a lot of excitement to the conference. For example, I had almost forgotten how great the lightning talks are. These are 5 minute talks about whatever you are doing or find interesting. The 5-minute limit is an example of a "liberating constraint," because people are willing to take far more risks if it's only 5 minutes. Also, you can easily get a last-minute inspiration and do a talk. Because it's 5 minutes, you don't dally or wander -- you get right to the meat of your subject. And for the audience, it's especially nice because if there's a talk that doesn't interest you or you don't understand, all you have to do is wait 5 minutes. And the things that you learn are far broader than you will find in the more formal talks. My favorite was a use of PyGame, a 3-D game-building framework that's been around for years and continues to amaze me, and is apparently used for commercial products. The presenter apparently holds a contest each year, and this year's theme was randomness. He had created a game called "Ducks" which had delightfully primitive drawings for the graphics. The ducks would chase you, drop things, etc. We didn't see much of it but it was hilarious; a game I'd like to play.

PyCon also has "sprints" before or after the conference proper, where you get together around a topic and work on it for 1-4 days; typically this involves writing code but I coached one where we were just exploring a topic; it was really more of an OpenSpace but I found it helpful.

Although I learned a great deal from the half-hour presentations, the lightning talks and OpenSpace events were what passed the nod test. When I travel to a different time zone I don't sleep that well, and the best way to help me catch up on my sleep is to put me in a room and do an eyes-forward presentation. Since I'm not interacting, the steady words from the presenter will often send me off. It's clear in those situations that I'm sleep deprived. But when the environment is more energetic and interactive (and even though the lightning talks were presentations, they felt more interactive), I feel very awake.

I have organized a number of meetings where we relied solely on OpenSpaces, which means that everyone in the meeting decided what was important to them and everyone at a particular OpenSpace was actively interested in the topic. These are the most nonstop energizing experiences I've had, and the only downside is that at conventional conferences like SD and even at PyCon, I am very aware of "energy gaps," which in the past I've simply accepted as inevitable and unavoidable. Once you've experienced an OpenSpace conference you wake up to the possibilities of what the word "conference" can really mean (both of the conferences I am holding this summer are OpenSpace conferences).

PyCon is more of an agile conference, and they are constantly re-evaluating things. One topic that came up was that a significant number of attendees who are newer to the language would like some sort of tutorial material to come up to speed so that the regular sessions would make more sense to them. So PyCon needs to become a little more like SD in that sense. SD could use more of the kinds of things that inject energy into the atmosphere that PyCon has. And, although PyCon already recognized this, both conferences need to do things that bring people together in the evenings. The PyCon folks tried to get a party sponsored this year, but I've never found a conference-wide party to be all that stimulating, and as they discovered it costs a lot and takes a lot of effort; the payoff isn't that great, in my opinion. A simple thing I've seen done at some conferences is just helping people get into groups to go out to dinner. These could organize around a speaker or a topic, and should probably have limits on size since dinner doesn't scale up so well. Another possibility is to have evenings that are exclusively OpenSpace oriented, since then there would be no competition with talks (perhaps at a conference, most or all of the OpenSpaces should be moved to the evening for this reason).

To me, the best things that happen at a conference are those that start conversations and interactions with people. After all, the reason that we travel from all over the place and come together in the same physical space is to connect. Especially with the internet, where we can do online everything that doesn't involve connection.

MindView Home Page

Thursday, March 24, 2005

More Jobs

Last week at the SD conference Bill Venners heard from the people at that the job postings this month are twice what they were last year at this time.

This week at the Python conference in DC we were handed a bag at registration that contained many sheets of paper from different companies saying "we're hiring Python programmers." This says a lot about both the economy and Python.

The conference has roughly 25% more people this year than last. We've outgrown the conference center at GWU, and will have to go to a larger facility.

The conference continues to be very good, very high energy. There is talk of adding a more introductory tutorial track next year, since it has more of the flavor of a technical conference and some folks would like to get up to speed on more of the fundamentals.

Guido Van Rossum gave his "State of Python" keynote this morning, and the formerly-named "optional static typing" has evolved nicely into something that seems more palatable, and will be renamed since it really isn't about static typing. Everything is still in the early stages but I think that something very interesting could result, that would NOT get in the way (which is what most people have been afraid of when the phrase "static typing" was used).

MindView Home Page

Thursday, March 17, 2005

Agile moves to the next phase

I'm attending and speaking at the Software Development Conference in Santa Clara this week (this is the same conference where, for many years, I chaired the C++ and Java tracks). Last night a group of us (myself, Bill Venners, Chuck Allison, Allen Holub, and Eric Evans, who wrote "Domain-Driven Design"), went to dinner at the White Lotus in San Jose, a place I try to get back to every time I'm in town.

That day I had seen, among other things, an agile talk Robert Martin and one by Mary Poppendieck. Although I've been following the printed literature, the last time I had seen any agile talks was at least a couple of years ago. What most impressed me by these two talks is the focus and the level of polish, in particular the shift to more evidence-based presentations. These are far more convincing and compelling arguments than the presentations that appeared when XP and agile initially appeared; I would classify those presentations as being more "enthusiasm-based."

Eric has been attending XP and Agile conferences and following everything more closely than I, and he said that someone at one of the recent conferences had made a presentation that pointed out that the early adopter phase had ended, and the current phase of adopters are more conservative and require clearer evidence in order to be convinced. Because I had already had my own XP-like experiences by the time XP appeared, the enthusiasm-based approach worked on me, but I found that these two presentations had a much more solid and mature feel to them. Of course, the fact that the presenters were very good made a big difference, as well.

MindView Home Page

Wednesday, March 09, 2005

Adapters and Interfaces Sprint at PyCon

I'm coaching the Adapters and Interfaces Sprint on Tuesday, March 22 at the Python Conference. If you are interested please add your name to the list so I'll know whether to actually do it.

MindView Home Page

.NET and Java on the desktop

I'm out in the boonies for a few days where there is only a phone line (and a slow one at that). My new notebook computer came with a bunch of free AOL hours so I thought I'd try that (although I used AOL many many years ago, I haven't paid attention since then). All I want to do is get on the internet, so I don't care. The signup process works fairly well, but I've noticed that in the last few days my mailblocks anti-spam service has been receiving messages but I've had only intermittent luck sending them. I tried emailing their tech support about this and they suggested that I have too many cookies in my browser. Of course I'm using a non-browser email client and so this is completely inappropriate feedback, but this kind of "support" is consistent with what I've gotten from them since AOL bought them.

So my scheme is to use the AOL SMTP address for sending mail, instead of the mailblocks address. But what could that be? I decide to try the online help, and it comes back and says "You will need to activate Java technology in your browser to use NetAgent - Java Customer Client." The notebook is very new and I haven't, in fact, installed Java yet. But I find this interesting because I can't imagine that most people who need help and click on this is going to have any idea how to "activate Java technology" in their browser. (When I did install Java, the AOL instructions didn't work).

I tried installing the RSSReader on this notebook, and it warned me that I would need .NET installed on the machine in order to use it. I hadn't installed .NET and so I thought I'd see how the system responded if I tried to do it anyway. It installed without any questions, and I discovered that somehow I already had .NET 1.1 on the machine. Without explicitly installing it. Apparently it comes as part of the service pack. Very convenient if you want to distribute a .NET application, but it certainly puts Java at a disadvantage. On the other hand, there are apparently large numbers of unwashed masses still using Windows 95 and 98, so developing any kind of application that doesn't run on those will be problematic.

MindView Home Page

Tuesday, March 01, 2005

Destructors in GCed languages II

In response to Destructors in GCed languages, Walter Bright added this point:

6) The destructors can automatically call the base destructors, and they do that. But they cannot automatically call destructors on the members. The reason is that class objects are by reference only, so the members are by reference, so the destructor cannot tell if someone else is holding that reference as well. So it can't call the destructor on them. (It could if it used reference counting memory management, but D uses mark/sweep.)

In C++, it's possible to embed member objects in their enclosing class, and so objects of that class clearly "own" the member objects and cleanup can occur deterministically. UML even has a way to graphically distinguish between embedded objects and shared objects.

As soon as you start sharing objects, however, you lose the determinism and so it would seem that there isn't a way to automatically call destructors for member objects.

But how useful is a destructor that does this? It only solves part of the problem, and leaves the rest to the programmer. I think this is why the Java designers decided to punt on the whole destructor issue, for the same reason as Walter gave, which is more generally "our garbage collector is not deterministic enough to know when to clean up objects."

Is this actually this issue, though? Suppose we separate the ideas of memory reclamation and object cleanup, and say that the nondeterministic garbage collector handles memory reclamation and some other mechanism handles object cleanup. This is what Java does, but you are provided with the finally clause in order to achieve non-memory object cleanup. D tries to go a step further and create a destructor mechanism, but stops before calling member object destructors and thus might do more harm (by implying complete destruction) than good.

Let's look at the implication that reference counting and garbage collection are the same thing. Reference counting can certainly be used as a garbage collection mechanism, as we see in Python. But reference counting is what its name implies: a way to keep track of the number of references there are to a particular object. The problem with calling destructors for shared objects is exactly this: you need to know whether there are any other references to an object before calling its destructor.

It's fairly easy to write a reference-counting implementation to keep track of the references to a shared object so that you can know when to call the destructor. And this runs within a system that has a separate garbage collector.

The downside is that the programmer is responsible for calling any "addRef" method, and it would be nice if it could all be automated.

If you distinguish between the garbage collector for memory reclamation, and reference counting for destruction of shared objects, I think it is possible to solve the automatic destructor problem for garbage-collected languages. Here's how it could work:

  1. If a class has a destructor, the compiler adds reference counting to that class.
  2. Any time a new reference is attached to an object of that class, the reference count is incremented automatically.
  3. As a reference disappears, it decrements the reference to an object.
  4. When an object's reference count goes to zero, the destructor is called.

Basically, the reference-counting mechanism is running in parallel with the regular nondeterministic garbage collector, and reference counting is only attached to objects that have destructors. By separating the two (reference counting for destructors vs. garbage collection for memory release), I believe this would not only allow a completely automatic destructor to be created -- one that would properly clean up member objects -- but I think it would also eliminate the need to explicitly call destructors in finally clauses. I don't know of any situation where you must explicitly call destructors in Python; as soon as the reference count goes to zero the destructor is called.

(Later) Walter commented:

D goes further than just offering finally blocks, it also offers scoped destruction when the 'auto' storage class is used. The scoped destruction can be used for resource management just as in C++, there are other nifty uses for it such as timing code, see

It doesn't automatically resolve the issue of running destructors on members deterministically, but if you write your class putting such members as 'private' members, and don't create other references to them, you can use the 'delete' operator on them to deterministically clean them up.

MindView Home Page