Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public variables
Message
 
À
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:
00668006
Vues:
24
>Hi Sergey!
>
>>The good practice is not to use public variables at all.
>
>Why?

Fernando;

There are many things developers learn to do and to not do. Sometimes you respect the word of someone that is well known and experienced and do not worry about the details. Other times you experienced the problem, which may have taken hours to resolve.

When VFP came out I had some great training from several sources. They all said, “Do not use public variables”! I have worked with many developers over the years. Let me tell you about two of them.

1. This developer loved to sub class objects and use inheritance. Also, the developer liked to place Public variables in interesting places – like child objects. I cannot express the joy of working on that developers project!
2. Developer number two had 56 Public variables declared in a variety of places and caused some serious issues. I was given this project to resolve the many issues. What occurred with this application was a classic example of why to not use Public variables! I will explain below what I mean.

The client took delivery of the application and at the end of the month ran closing reports for the month’s activities. The application “blew up” and I was asked to resolve the problem. The developer who created the application having used 56 Public variables also changed the type from character to numeric and numeric to character as well as interchanging date with character and numeric. All was well until the user hit these changes in data types.

I avoid Public variables in all my Visual FoxPro applications and I have never regretted it!

Tom
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform