Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening all dbfs in a directory
Message
De
23/10/2013 01:24:51
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01585571
Message ID:
01586198
Vues:
57
>>>>We're finally getting somewhere! You did not use any PUBLIC variables.
>>>
>>>And the cycle resets...
>>>
>>>Do you guys remember "Lost"? Remember there was this sequence of numbers that needed to be punched before some counter elapsed? Discussions about PUBLIC variables seem to also have some frequency, I wonder what would happen if one day we forget to start the thread to discuss about them? Maybe that will signal the end of FoxPro, or the world!
>>
>>The point is to teach best practices.
>
>Well, I think you know that I not only agree with you about the use of public variables, I think you also know I go one or two steps further: no PRIVATE variables and no PUBLIC properties either, any changes in the state of an object should be accomplished by sending a message to it, never by assigning a value to a property (which should be protected anyways, or even hidden).
>
>Anyways, and to the risk of being called unprofessional by Al, I would say that, to my taste (which is, like any other's imperfect), you were not following best practices either in that small piece of code, as it was a function (or method) that was performing two distinctive tasks; so maybe a better solution would have been to separate the searching of the files (which can then be used for other purposes) with the actual testing of the files (and this should be done in two methods, one that checks an individual table and then one that checks a collection of tables, the output of the method that finds the files in the first place)

Clearly I'm getting a bad rep around here :)

I usually end up with a few PUBLIC variables e.g. goApp, goUtils, goLogs etc. PRIVATE I avoid, that sort of scope is AFAIK unique to xBASE and a holdover from the pre-VFP days and an excellent source of obscure bugs. However it seems to be required in some instances e.g. making variables visible to reports when LOCAL doesn't cut it.

So far I haven't seen any so-called "experts" telling us about the joys of REGIONAL ;)

I agree with your separation idea. It's one facet of the "*n?x Way". I seem to recall George Tasker being a big proponent of this (haven't seen him here in a long time, his last logon was August 2011).
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform