in reply to globally seen vairable
Is there a way to introduce a variable which is defined in the main program and is seen from external modules.
Sure. See our.
What is a drawback of such a variable
There is extensive literature out there, for example search for why are global variables bad. In short: global state makes programs harder to understand, to debug, can cause problems with recursion and concurrency, and is often a sign of bad encapsulation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: globally seen variable
by vit (Friar) on Sep 28, 2010 at 18:15 UTC | |
by moritz (Cardinal) on Sep 28, 2010 at 18:20 UTC | |
by vit (Friar) on Sep 28, 2010 at 21:27 UTC | |
by moritz (Cardinal) on Sep 29, 2010 at 08:41 UTC | |
by BrowserUk (Patriarch) on Sep 28, 2010 at 21:44 UTC | |
by vit (Friar) on Sep 28, 2010 at 22:11 UTC | |
|