|
-
August 6th, 2009, 09:32 PM
#4
Re: Theory Question: Global Variables
The biggest problem with global variables is they increase coupling and impede code modularity. This makes it much harder to reuse code using globals. If the value of a global variable cannot be worked out at compiletime and instead is initialised at runtime there can also be initialization order issues.
Basically you should try to avoid using globals as much as possible. What you see now as convienience, may in fact be a complete headache as your project grows larger.
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|