good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The length is mostly down to documentation, as I'm sure you realise. Without the POD statements, it's more like 250 lines, and can be reduced still further by putting all assignments (especially in the Tk statements) on a single line. Isn't that always the way with documentation?
As far as the global variables are concerned, about half of them are bound to Tk widgets. I wanted to keep like with like, and declare them before I started declaring the widgets. On the same basis, I wanted all the global variables declared together. "All the rotten eggs in one basket". The code is laid out thuswise: use global variables Tk Bare block to load __DATA__ MainLoop Subroutines If this is bad style, I'd like to change it. But doing it this way fits my brain, so if there are reasons, I'd love to know them, whether by direct explanation or by reference. I can see that declaring a variable before it's needed can mean that it gets used accidentally. But given that there are only 8 of them, I felt that having them in a single block would mean that there was a reduced chance of double use, and an increased chance of seeing what each declaration was intended to achieve. Thanks and regards, John Davies In reply to Re^2: RFC: spam reporting assistant
by davies
|
|