Effective Tcl/Tk Programming 28
Effective Tcl/Tk Programming | |
author | Mark Harrison and Michael McLennan |
pages | |
publisher | Addison Wesley Publishing Company, Inc. |
rating | 8/10 |
reviewer | Jason Bennett |
ISBN | 0-201-63474-0 |
summary | A book for advanced Tcl/Tk programmers with thorough examples and good tips. As with most advanced books, it's probably better as a reference book than for pure reading, but its coverage is thorough enough to teach most Tclites a few tricks. |
Background
Greetings, all, I'm back once again. After my travels into the world of Tk a few weeks ago, I've branched out to include its sibling, Tcl, in all its glory. Tcl, I have to say, reminds me a lot of Lisp, at least in its typelessness and fondness for lists. I do miss all the (()), though :-).
What's the book about?
Generally speaking, it is designed as a sequel to any and all introductory Tcl books with a view toward more advanced and narrow concepts. The authors go through various parts of Tcl that the novice programmer might not use frequently, but the advanced programmer will find quite useful. The geometry managers are all covered in detail, so the advanced programmer can select the best one. The canvas widget, that all-purpose blank slate, is given quite a bit of room. The book even covers communicating with other programs on the same machine and through sockets. Most all aspects of Tcl and Tk are addressed to some extent, leaving few stones unturned. Of course, programmers on different levels and with different experiences will find different nuggets in here. Personally, I was well acquainted with the text widget, making chapter five somehwat redundant, but needed some help with communicating with other processes. YMMV. Generally, the book is composed of several large examples, with new features added in each chapter. There certainly is a great deal of code, relative to the amount of explanation, so a good grasp of Tcl is required. In addition, the final chapters deal with delivering a complete, cross-platform Tcl application to the marketplace, in terms of packaging and cross-platform compatability. There's a nice install program example, and plenty of cross-platform minefields mentioned.
What's Good?
This book is excellent for any Tcl programmer who's looking to add one of the skills covered in this book to his bag o'tricks. If you want to know more about text widgets, or using Tcl as a front-end to other programs, there's plenty of explanation and example to glean from this book. If you want to know more about general Tcl concepts like the event loop or the geometry manager, there's still more for you. There are also plenty of concepts addressed that could be applied to other GUI efforts outside of pure Tcl/Tk. I wouldn't necessarily read the book just for those, but they are a welcome addition. The examples in particular are quite thorough, with extra code available that is not printed in the book. There's even an entire calander manager written that's quite full-featured. Any topic covered comes with not only text but plenty of code. Commercial Tcl developers will especially appreciate the emphasis on professional Tcl libraries and delivery. If you do Tcl for a living, you'll appreciate this book.
What's Bad?
If you don't want to delve deep into Tcl, don't bother with this book. You'll end up having to deal with areas of the language you never wanted to know, and you'll end up frustrated. Similarly, I wouldn't recommend reading this from beginning to end unless you love Tcl. There are plenty of parts where the flow is bogged down by the endless obscure code, and if you aren't interested, you'll end up skipping it anyways. Skim the parts that you don't need now, and come back to them.
What's In It For Us?
Since I know there are plenty of Tcl fans out there, I'm sure there will be plenty of interest in this book. As I said, if you're just starting with Tcl, hold off on this one. If, however, you've honed your Tcl skills, but need some extra help in some areas, this book is for you. Whether you're into sockets with Tcl or just want to use that text widget more effectively, you will find this book useful. I'm sure it will be coming off the shelf for reference much in the future.
To purchase this book, head over to FatBrain.com, and pick it up.
I don't think Tk exists without Tcl... (Score:1)
I believe that someone was working on a Tcl-less version of Tk, but that's not the one that everyone uses.
Someone correct me if I'm wrong...
Comparison with Welch's book? (Score:1)
They're both good books. Welch's is the expansive, complete reference.
Harrison/McLennan is more like the hot-insider-tips kind of book. It points out a lot of cool, but inobvious, things.
McLennan's *The Man*... (Score:1)
He created the [Incr Tcl] and derivative extensions. And in addition to the above book, he contributed a couple of good chapters to O'Reilly's excellent "Tcl/Tk Tools" - a compendium of Tcl/Tk extensions - which Harrison edited.
Beware of Tcl! Use Python instead. (Score:1)
If your UI does not need to be crossplatform, pygtk [daa.com.au] may be a an even better choice. It has more widgets, is fast, and you can also write GNOME apps with the companion pygnome modules. (The pygnome package includes pygtk.)
Beware of Tcl! (Score:1)
I mean, what do you expect from a language designer who distinguishes between untyped and statically typed languages? And either has never heard of dynamic typing or chooses to ignore it? Who thinks that "all the world is a string"?
Do yourself, your employer, and your customers a favor, and stay away from Tcl.
Beware of Tcl! Use Python instead. (Score:1)
Sure TK exists without TCL (Score:1)
quote from O'Reilly book (Score:1)
Comparison with Welch's book? (Score:1)
Comparison with Welch's book? (Score:1)
I own both books. I find the Welch book to be a very good primer on using the language. McClennan/Harrison is a good book once you are up to speed on the basics. It covers a set of best practices from some guys who have written a lot of tcl code and in the process developed a set of useful techniques for Tcl programmers.
TCl and Debugging (Score:1)
Must have book (Score:2)
McClennan (author of [incr Tcl], founder of Tcl Consortium) was one of the most highly motivated and driven people I met at the conference. He ran more tutorials (one for each session) than anyone else there, ran the "Game Show" (including writing the software for it), and was also a conference co-chair.
He nows his stuff and, just as important, he know how to explain it.
Beware of Tcl! (Score:2)
Second, there seems to be a great deal of evidence that Tcl/Tk can handle its own in the real world. Scriptics ( www.scriptics.com [scriptics.com]) maintains a collection of success stories.
Tcl's main advantage is the ability to prototype extremely quickly. It was originally designed as a "glue" language, but has been far more useful than just that. If you find some aspect that is too slow, you can recode that module into C or C++ (or even java for cross-platform purposes) and link it in.
Tcl is also widely used in QA test automation. Many web sites use it as a back end. NBC presented a paper at the Tcl/Tk conference detailing how they use Tcl/Tk to deliver satellite feeds to affiliates (they originally planned to just do the prototype in Tcl and recode later, but found that they only had to replace a small number of modules).
TCl and Debugging (Score:1)
There are at least two debuggers for Tcl. One is from Don Libes, and comes as part of his Expect extension (although usable separately). See the Expect home page [nist.gov] for more info.
The other is the commercial offering from Scriptics [scriptics.com], John Ousterhout's company.
I'm sure if you check the Tcl FAQ you can find more. Check comp.lang.tcl.announce for the weekly summary postings, it will contain a link to the FAQ.
TCl and Debugging (Score:1)
where's the comparison? (Score:1)
Also - Tcl is not Tk's "brother" or whatever it was the reviewer put. Tcl is a scripting language and Tk was an extension made to that for GUI pruposes. Tcl is the important piece and without it, Tk doesn't exist. I think the reviewer needs some more Tcl experience before he can give an informed opinion on what was important and what wasn't. Generally, most people are fairly ignorant about the power of Tcl, though..
Beware of Tcl! (foo) (Score:1)
Tcl might not have worked for this guy in this project. He hasn't given any real reasons why, though. Knowing how and why Tcl didn't work out might be interesting and useful.
-BJK
TCl and Debugging (Score:1)
Doesn't include any information on how to debug the lanuage perchance. I have spent long pleasure filled hours resorting to the good ole reliable puts (printf for those of the C clan)to debug it.
I would sell my soul and carpent lint for a decent debugger. Still though not as bad as the days when I was writting speech systems in TCL. Had to spent several weeks in a padded romm after that