Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Commonly misused and abused VFP features
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00310951
Message ID:
00311080
Vues:
33
Hi Jim. The cold medicine is starting to kick in... I can be more verbose now. I'll cut and snip and bit to get to the points that I was interested in.

My apologies for the abruptness earlier. I didn't intend to sound flippant, but meant to engage you in discussion.

>Here's the beginning of a list of commonly misused and abused features, functions, and commadns fo VFP.

>1: Inheritence has to be the single most commonly misused feature of all OO languages.

This was certainly true in my case. In my early VFP days my class hierarchy had tons of levels, it is a bit more flat these days.

>2: SET FILTER TO ... is very often used where another construct would do the job much more efficiently and with better performance.

I have never used this feature. My alternative to would depend on the situation, but may include:
- a parameterized view
- a relation
- a browse for a "for" clause

>3: & the macro expansion feature is too often used where it is either not necessary or ther is a bettter way to accomplish the same goal.

The alternatives are named expressions and evaluate, as Nancy mentioned. Is there anything else you would recommend.

>4: Filtered indexes, are often used where they are not necessary. The same result can be obtained using SQL without the overhead of having an extra index tag around all the time.

Not sure what a filtered index is. Is it an index like "age > 18"?

>5: UNIQUE indexes, not only are they misused but they could easily be totally removed from the product without any alteration in capabilities.

I have never understood these and have avoided them.

>6: PUBLIC variables are often used in situations where they are totally not required.

Would the alternative be a property of an application object?

instead of gcLoginName you would use oApp.cLoginName ?

>7: SET EXACT is often used to cover for not understanding the way strings are compared in xBase. This causes the loss of a lot of functionality that is inherent in the product in order to adapt to a lack of knowledge.
>
>8: == is often NOT used where it should be. See SET EXACT above.

You are advocating = and == over SET EXACT, why?
I use = and == for more control and it seems more self documenting.

>9: Reports used for producing a screen display of readable data. Reports are for printing on paper, forms are for showing on screen. Report Preview is for eyeballing before committing to paper.

I agree for the most part.

>10: PACK is too often sued in situations where any benefit it porovides is far outweighted by the costs associated with it.

I don't understand. Could you explain?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform