Friday, February 18, 2005

James Gosling on SWT

Some good points by Gosling on why SWT is a fast, light weight way to (porting) hell...

"The SWT thing was just…it pissed me off beyond words. So, if you wind back the clock a few years, the original toolkit in Java was this thing called AWT, the Abstract Window Toolkit. It’s still there, and it’s a fairly simple, straightforward toolkit, and it’s based on using the widgets from the underlying (inaudible). It had a wide variety of really, really ugly problems, things like how to get semantics consistent from platform to platform, and some of the little fringe things like cut and paste. Trying to get cut and paste to operate correctly between text widgets, like between the Mac text widgets, the Motif text widgets and the Windows text widgets. When you’re actually trying to use those text widgets in their native homes, it’s just a nightmare. How do you deal with things like subcopying, how do you make a button extensible? How do you deal with the more advanced features that people want, like being able to do tables where you can control the rendering of components and cells and that kind of stuff?

A lot of those things were completely precluded by the AWT architecture. IBM in particular was really upset about the way that the AWT architecture had gone, and they were one of the leading agitators that caused Flame to be created. In fact, about half of the engineers on the Flame team were actually from IBM -- they actually got IBM pay cheques. IBM built Apple Flame, and actually then Swing was quite successful, it’s been successful for quite a while. The biggest problem with Swing was that it can do so much that it’s kind of become like the 747 cockpit if you like APIs. There’s a lot of complexity there, and the hard part is figuring out how to use it. It’s in this weird situation where pretty much anything you can want to do in Swing, you can do easily. But what’s hard is to figure out the easy path through all of the different options, the different ways you can do things. Once you figure out the one true path to get what you want done, then it’s pretty easy. People often say “Why don’t you just make it easier by simplifying it?”, and say, “so you simplify it in this way, it would make my life better”. But then for the next guy it would be worse, because he wants to not go there, he wants to go on this particular path. So it’s been difficult to manage the complexity right.

So, wind the clock forward a few years, and there’s (inaudible) from IBM (inaudible) “Swing is too complicated, let’s do AWT all over again”, and if you look at the SWT architecture, it’s almost exactly the same as AWT. It has all the AWT problems: it’s way simple, it doesn’t port very well. And its API is somewhat different, because essentially what they did was they made the Windows version really easy by making their API pretty much a clone of the Windows API. And then on Linux, they tried to make Motif look like the Windows toolkit. They’ve got those mapping layers that are just like, really horrible, and it only kind of works. And same thing in OS X, their porting problems from platform to platform is a nightmare, their consistency (inaudible) is a nightmare. And it’s sort of like, “You were there seven or eight years ago. It was a bad place to be, don’t go back!”. The problem is that IBM is like three hundred and some-odd thousand people, so there’s like a cluster of people. Most of the people we were working with back then were in North Carolina and New York State, like Westchester, and they actually understood things pretty well."

Original Q& A transcript - James Gosling Q & A

No comments: