September 2003
A Comparison of Tcl/Tk Titles
by Cameron Laird
Tcl/Tk: A Developer's Guide
Clif Flynt
Morgan Kaufmann, May 2003
ISBN: 1558608028
Practical Programming in Tcl and Tk, 4th ed
Brent Welch, Ken Jones, and Jeff Hobbs
Prentice Hall PTR, 2003
ISBN: 0130385603
Is there a point to reading Tcl/Tk: A Developer's Guide? As harsh as that question sounds, it's appropriate in a world that already offers Practical Programming in Tcl and Tk. Tcl/Tk: A Developer's Guide is an interesting, intelligent, and accurate book. Its organization and editing make it easy to read, yet it successfully tackles deep and challenging ideas. But Practical Programming in Tcl and Tk, 4th ed has most of the same characteristics. Practical Programming in Tcl and Tk, moreover, is the recognized market leader, and boasts unique coverage of such specific important topics as the use of Tk with other languages, internationalization, 40 pages on the features and changes associated with specific releases of Tcl, and unrivaled attention to Tcl's ability to be extended and embedded. It's comparably current, with full coverage of release 8.4 as the most recent production distribution.
Is Tcl/Tk: A Developer's Guide left with any advantages, then? Are there any prospective readers who will prefer it to Practical Programming in Tcl and Tk, 4th ed? Yes.
Good reading
Tcl/Tk: A Developer's Guide is particularly valuable for those who want to learn Tcl, and all they can do with it. Author Clif Flynt also wrote and maintains the popular TclTutor application, and his engagement with newcomers to Tcl is evident. Practical Programming in Tcl and Tk makes the better reference, in most details, but is less inviting for a programmer who doesn't yet know what he needs to learn. While the most recent edition of Practical Programming in Tcl and Tk has a superb index and smoothes out the occasional abruptness of the earlier editions, it still demands more background of its readers.
Tcl/Tk: A Developer's Guide is "self-contained", in that regard. Carefully study Chapter 11, for example, and you'll not only know how the text widget works, but you'll have practiced thinking about its limits, how to apply text to the most common development requirements, and how to spot and correct common errors. Practical Programming in Tcl and Tk has essentially all the same material it simply doesn't go to the same lengths to keep the reader on course.
There are specific topics that Tcl/Tk: A Developer's Guide handles more completely than Practical Programming in Tcl and Tk. It's typical that, although both dispatch tk_chooseColor in only a single paragraph, Practical Programming in Tcl and Tk specifies its return value merely as a "color", while Tcl/Tk: A Developer's Guide invests the few extra words to make clear that it's a RGB value such as #90909e . Tcl/Tk: A Developer's Guide, moreover, takes the trouble to reproduce the platform-specific tk_chooseColor displays for Unix, Windows, and Macintosh.
The same Chapter 12 of Tcl/Tk: A Developer's Guide includes a subject no other book more than mentions production-quality construction of namespace-based "megawidgets". Professional programmers intending to use Tk for complex graphical user interfaces (GUIs) need this information, which corresponds closely to "subclassing" with other GUI toolkits.
Another strength of Tcl/Tk: A Developer's Guide is its explanation of "the Tcl way" in regard to data structures. Tcl has a degenerately simple syntax that, at base, treats all values as strings. This confuses and frustrates programmers coming from C, for example, who are accustomed to thinking in terms of arrays, structures, statically-typed variables, and so on. Chapter 6 on "Building Data Structures with Lists and Arrays" shows off what Tcl can do in the hands of an expert.
Happy combinations
Tcl/Tk: A Developer's Guide's first edition was titled Tcl/Tk for Real Programmers. Tcl/Tk: A Developer's Guide reveals that heritage in its unusual concluding three chapters and appendixes, which are mostly not about Tcl itself, but about other things that make Tcl more valuable, or other things that Tcl makes more valuable. Chapter 14, for instance, is "Extensions and Packages", about the "third-party" software that enhances Tcl for development in such specific domains as systems administration, database management, and complex GUIs.
A final Tcl/Tk: A Developer's Guide feature that merits recognition are the hundred-plus "Problems" that appear at the ends of most chapters. They cleverly focus a reader's attention on important details beyond the scope of the main text.
So, yes, there is a niche for Tcl/Tk: A Developer's Guide. Neither as encyclopedic as Practical Programming in Tcl and Tk, nor as deeply detailed as the books on a single specialized Tcl topic, it does the most for a working programmer focused on delivering commercially acceptable GUIfied applications coded in Tcl/Tk.
Vice President of Phaseit, Inc., Cameron Laird frequently reviews books for UnixReview, and co-authors the monthly "Regular Expressions" column. Many of the applications he develops for Phaseit are written at least in part in Tcl, and he's contributed code and documentation back to the Tcl project since the mid-'90s.
|