Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening all dbfs in a directory
Message
De
25/10/2013 04:27:32
 
 
À
25/10/2013 04:19:44
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:
01586349
Vues:
48
>>>>>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)
>
>Long time ago, I wrote XDIR ( File#25487 ) which is class that scans content of folders and subfolders (or entire drives for that metter) and streams it all to
>appropriate class methods. So any processing of files can be simply placed in subclass method 'WithFile' hiding completely complexity of traversing through folder hierarchy and files. Ever since then I saw numerous posts with code that does the same thing one way or another. It is perhaps BEST COVERED
>programming task of all times. What occurred to me is that people absolutely LOVE writing recursive code on their own because everyone think it is cool ! :))
>(That task in particular is very convenient playground because it is where recursion concept really makes sense due to the nature of it all.)
>
>So everyone likes having their own funcs & procs that do the same thing. Maybe not the best practice and all that, but I do understand why is happening;
>Whole OOP approach (frameworks especially) directly steps on oldest and biggest pain of all programmers which is well known dificulty to to read,
>understand and apply someone else code. I think 100 out of 100 programmers prefer to write their own (myself first!) versus using ready made stuff.
>Publics no publics, best practice or not, we love to write code because that is who we are! :)

Wrong button! No more edits {g}
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform