__ in names to separate words, as in
# USE this style set this_is_the_answer 42 # NOT this style set thisIsATheAnswer 42
This will make your program more readable.
GT and
the prefix GT for global names.
GT_Graph,
GT_Tcl_Graph.
father,
son, next_son.
Use defensive programming whenever possible. Defensive programming means: any function must act gracefully if there is an error. For example, functions must check for empty lists.
Some hints to generate portable code in Tcl:
file command for dealing with files.
Especially, use file join to construct paths.
fileevent is not supported on Windows.
tcl_platform contains information on
the current platform. Similarly, $tcl_version and
$tcl_patchlevel hold the current Tcl version and patchlevel.