Passing by reference

Hendrik van Rooyen mail at microcorp.co.za
Sat Dec 22 02:59:43 EST 2007


MartinRinehart Wrote:


> More seriously, I can and do use lots of globals. In the tokenizer I'm
> writing, for example, all the token types(COMMENT_EOL = 0,
> CONSTANT_INTEGER = 1, ...) are global constants. The text to be
> tokenized is a global variable. (Actually, the text is unchanging once
> the Tok object is created, so this "variable" may be another
> constant.) Passing global constants to functions is a case of CPU
> abuse.
> 
> Structured purists gave globals a bad rap, years ago. Time to stick up
> for them. They're good citizens. Don't blame them if some dumb coder
> abuses them. It's not their fault.

*grin* 

It is good to see that I am not the only person in the squad who hears
the beat of this drum.

I wonder if you have some COBOL data divisions under your belt?

- Hendrik




More information about the Python-list mailing list