Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public variables
Message
De
12/06/2002 14:20:32
 
 
À
12/06/2002 11:03:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00667392
Message ID:
00667563
Vues:
30
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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform