Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public variable
Message
From
15/03/2011 10:11:24
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
13/03/2011 22:53:16
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
01503562
Message ID:
01503703
Views:
53
>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
Map
View

Click here to load this message in the networking platform