>I have read in several messages, including some in reponse to my own inquiries, that use of public variables is not good practice. If so, what are the primary reasons?
Public variables can be changed by any called subroutine. This is not an OOP issue because the the ramifications of this affect procedural code as well as objects. If you use a public variable and you call a subroutine that uses and automatically scoped variable (not declared local, local, private, or public), any values the subroutine assigns to "its" variable will change the value of the global (public) variable. This can cause all sort of unexpected and hard to find side effects.
Previous
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