Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A Private Global Variable
Message
De
18/06/2002 07:08:28
 
 
À
17/06/2002 21:18:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00669192
Message ID:
00669630
Vues:
14
>Hi Peter,
>
>You wrote:
>>Why do you and many others blame bugs to the mere existence of PUBLIC and PRIVATE? Why not blame CLEAR ALL? Why not blame the programmer for being careless?
>
>If you read my rather lengthy 2 cents worth, I can't see how you would conclude that I am one who "blame bugs on the mere existence of PUBLIC and PRIVATE." In my last paragraph, I freely admit that I still use public variables in a few instances. I was only pointing out that public and private variables can be troublesome if not used properly.

Hi Elmer,
You're right. I shouldn't have said 'you and many others'. It suggests something that was not my intention. And, after rereading, I recognize better now that you blame it more on the careless programmer.
But, (to my defense?) you began your writing with:
'Public variables, private variables as well as "global" private variables declared in your main program can be troublesome, especially with sloppy programming ...'
Perhaps you should have written: 'Sloppy programming causes trouble. An example of sloppy programming are some practices with regard to declaration of variables.'
Your starting words made my mindset while reading the text.


[SNIP]
>As far as setting a standard that all variables beginning with "g" should be considered global/private, you can set your own standard and do that now with the existing VFP. Just document it as such and use it. Personally I use the _underscore before a variable name to indicate that it is a

I know, and I do. So does JimB. But do you think it would be good idea to propagate to the community the idea of g as demonimator of public variables AND variables declared private in the main program? That was my question.


[SNIP]
>To make it clear, I have no problem using public, private, or local variables. They are included in VFP for a reason, perhaps just legacy code or perhaps because with proper application, they can solve some programming issues. I think that the key is proper use and declaration of all variables, comment your code and document what you do and why you do it.

Agree fully. :)
BTW, I think private variables are more difficult to handle, and thus pose a bigger thread, than global variables. The chances that the global variable exists are quite big. We can only hope that a private variable exists at the moment of its usage.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform