I like to program graphical user interfaces (GUIs) with Tk; it's one of my two favorite GUI toolkits. I'll give several tips about GUI construction with Tk. I suspect at last some of this will apply to you. Next week, "Smart Development" will do the same for my other favorite GUI toolkit.

Understand, first, that a posting like this can achieve no more than a few tips. As much as I appreciate clarity and simplicity, a majority of the writing on programming that people apparently find persuasive is woefully truncated. Look, for a quick example, at Tk 8.5 is better than wxWidgets on Windows". Author BIOSPUD writes well, in that he clearly explains himself: he explains his focus on cross-platform capabilities (where Tk does indeed shine), he lucidly describes the dimensions along which he compares Tk, Swing, and wxWindows, he specifies crucial details (such as release number), and so on.

And he still covers only a small fraction of what there is to know. My impression of BIOSPUD is that he's aware of this. I've heard readers react to such articles, though, and they seem to internalize a post like his as, "Tk roolz!", without recognition that:

the comparison doesn't touch on such important toolkits as Qt, GTK, and .NET;

Tk has already moved on to 8.6 for production, wxWidgets has development snapshots at 2.9.0, and so on;

there's no discussion of performance or features;

there's little mention of the compatibility of the toolkits with different languages;

and so on. Modern toolkits are big, highly-evolved constructions, essentially all of which embed at least a decade of experience. Even full-length books--an outstanding one on Tcl/Tk just hit the bookshelves--can cover only a fraction of what there is to know.

The conclusion? Choice of a GUI toolkit is complex. Every toolkit has a lot to recommend it, and every one has defects. You're only deceiving yourself if you think you've found the absolute best. What we can do, though, is talk meaningfully about the situations where different ones shine, and how to make the best use of each toolkit in different circumstances.

While I'm not surprised that Tk correctly handles the font measurements BIOSPUD describes, I certainly wasn't aware of the specific comparison that seems so important to him. I'm insensitive to a lot of the visual details on which others focus. My favorite GUI applications go into factories (for baking bread, blending gasoline, building ships, ...) where the emphasis is on software that will run for ten years without disturbance, rather than tracking this season's visual style. While I'm happy to take advantage of alpha transparency and rounded corners and such, I spend far less time with them than I do looking for simple, light-weight, robust, predictable source.

Tk comes through for me in that regard. Tomorrow I'll return with a few code samples to illustrate what I mean. In the meantime, though, be aware that Tk is a leader in handling Unicode, that "Tk widgets look fine under Windows", and that Tk's underlying Tcl base has plenty to recommend it, including:

special security facilities;

clever networking and concurrency interfaces, strong enough to inspire imitation by such new projects as Go;

outstanding portability; and

convenient licensing

which are crucial for me.