[Tutor] Slightly OT: public/private class members

alan.gauld@bt.com alan.gauld@bt.com
Fri Feb 14 12:40:10 2003


> Short scripts have a tendancy to evolve into production code, so I
> use this feature (in Perl) for all the code I write, even the short
> ones (my code tends to look like "textbook" code).

Very true, I probably should have said one-off scripts. I write a 
lot of code that gets used to demonstrate something and then is 
never seen again.

BTW There is one down side to pre declaration of variables (aside 
from extra typing!) which hasn't been mentioned which is the tendency 
to leave 'orphaned' names. ie declarations where the variable was 
originally used but then the code changed and its no longer needed 
but the declaration gets left behind. I've seen studies that suggest 
one such variable exists for every 200 lines of C/C++. However the 
code bloat is hardly massive and I suspect a good optimiser would 
remove it anyhow.

Alan g.