total idiot question: +=, .=, etc...

Reimer Behrends behrends at
Sat Jun 26 01:17:26 EDT 1999

Alan Gauld (alan.gauld at wrote:
> Not so. If the method is long(as these were - over 200 lines 
> in some cases, mostly initialising huge DCE Data structures) 
> you can't see the local definitions. C++ compounds this with 
> its ability to declare local variables anywhere in the code
> (so a split screen editor doesn't help).

A program shouldn't have methods that are 200 lines long; as a rule of
thumb, any method should fit on a single screen (and I mean 80x24, not a
maximized xterm on a 21" monitor). And most methods should be much
shorter than that. If the code you have is screwed up like that, you
have much worse problems than scoping problems. If you need to
initialize large data structures, the initialization process needs to
be broken down into manageable entities (which can then be composed
and reused).

				Reimer Behrends

More information about the Python-list mailing list