Next: General Advices
Up: Using Tcl/Tk from
Previous: Loading Tcl/Tk Scripts
The Tcl language has no modular structure, no objects and no local name spaces
(except for procedure bodies) and it is thus advisable to
follow some structuring rules when writing Tcl/Tk code.
Here are a few suggestions:
- Code for each separate window should be located in a separate file,
including procedures that are called as commands or that process
data that belong to this window.
- Each procedure should have a short comment explaining what it does.
- Procedure and global variable names should be prefixed with
the name of the file or window they belong to.
- Procedures that operate on windows should always have the
window path as an argument (usually w); hard-coded window paths
should be avoided.
Micha Meier
Tue Jul 2 09:49:39 MET DST 1996