Mike Yearwood
Toronto, Ontario, Canada
>I use a lot of public variables using AddProperty()
>
>is there any disadvantage using too much public variables?
>
>thanks for the help
I saw a program where a public variable would have resulted in patient fatalities. The patient a was stored in a public variable. Open another window and load a new patient - now the public variable holds patient b. Go back to the first window. Changes made now affect patient b. As I pointed out, if patient a needed clot busters and patient b was a hemophiliac, potentially two deaths. Had these programmers put the patient id in the form it would have been smarter.
Public variables and properties should be very rare. The benefit to putting properties in an object is that with an object you can at least control changes.
Should we wait for a major disaster, like Japan's nuclear stations, or an airline accident to not do a stupid or even fatal thing?
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