Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public variables
Message
From
12/06/2002 14:20:32
 
 
To
12/06/2002 11:03:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00667392
Message ID:
00667563
Views:
31
Fernando,

Sergey doesn't really answer WHY, so I'll offer some reasoning...

Especially when running under the VFP IDE and debugging, there can easily be problems that some variable (public) long ago defined and forgotten in the session can get in the way of the current activities. You may have worked on one application, then switched to another, and the publics from the first can mess up the second.

While YOU know your systems and your general practises regarding public usage, you can easily get into trouble when working on someone else' application, who may well have different (standard) practises than you. Back to the IDE/debugging again.

And the same holds when your program(s) are being worked on by others.

I *do* continues to use publics myself, but in extremely limited instances. And I know that I would do better if I eliminated my use of them. It is a case of 'why ask for trouble', especially when finding the cause of a malfunction can be very hard to find (more to the point, too easy to overlook) when it is a public messing things up.

Cheers


>Hi Sergey!
>
>>The good practice is not to use public variables at all.
>
>Why?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform