in reply to Tk programming style

From personal experience, code using Tk invariably seems to end up fairly horrible to look at.

The structure of the parameters passed to the procedures, and the seeming large number of these, leads either to a large number of "temporary" variables to store them, which simply leads to confusion when it comes to maintenance, or to code which seems definitively unclear.

From having written a number of fairly large Tk programs, I've developed, and try to stick to, a style of careful spacing when it comes to defining and using widgets. While I'm not certain this is the best method of writing a script, it does serve to make the previously horrible-to-look-at calls much cleaner, with obvious benefits when debugging and maintaining the code.

I do make use of global variables with Tk, simply because it makes the use of subs to carry out functions much easier. Avoiding this, as you say, results in fairly unclear code.

I personally think that neither style is definitively "better". If the script can be easily understood, maintained and extended, then whichever style has been used is obviously the better one. This, I think, depends muchly on the length and complexity of the script, and is something best determined while thinking about the overall design of the program.

I guess my opinion is to try and keep stuff as simple as possible, when it comes to layout, variable referencing and parameter passing, hopefully giving something that you can work from in the future.

Just some quick thoughts ..
--Foxcub