Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2003 Server
>>For instance, it can be a problem to have many global variables. (The application object is a single global variable, which stores, in its properties, many different things.)
>
>PMFJI,
>
>What type of kind of a problem you can have with many global/public variables? I do use public variables in my application and would like to know when (at how many of those) I should start changing from public variables to one object.
The problem with global variables lies in any piece of code being able to change the content at any time, especially unexpectedly.
An object can control the circumstances of property changes. Further, a class has property descriptions as well as the property name and value. This makes for self-documenting code. Safer than public variables and more descriptive means better in my opinion.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only