> Today I use VFP to improve my own productivity and distribute my work to a very small community.
>
> Foxite is a great resource for keeping me out of trouble, but someday I know I'll need to hire an expert to make my applications more robust and networkable.
>
> So I direct my query to you VFP consultants in Foxite land: What are the common coding practices that newbies make that I should avoid to make your consulting life easier?
>
> Three things I've heard on Foxite so far
>
> 1. Keep public variables to a minimum
> 2. Use Hungarian notation
> 3. Create your own subclasses of the VFP base classes
> 4. . .
> 5. . .
>
> Are there certain coding practices that make you want to tear your hair out?
>
> Dan Baker
> Effort of the Poconos, PA, USA
One more advise: when dealing with tables/cursors - try to use fully qualified fields' names, that is use the alias names with them, i.e.
m.CustAddr = CUSTOMERS.Address1 + CUSTOMERS.Address2
&& instead of
SELECT CUSTOMERS
m.CustAddr = Address1 + Address2
First off, it would save you a line of code (no need to SELECT CUSTOMERS).
Second, it makes your code independent of the currently selected work area.
Moreover, I would recommend using the explicit reference to the pertained table's alias every time, everywhere! For instance:
REPLACE CUSTOMERS.Inception WITH DATE(), ;
CUSTOMERS.Category WITH "New" IN CUSTOMERS
this would save you - and VFP - from a lot of confusions (and therefore - program errors) over what field belong to what table, especially if you have identical field names in different tables (which does happen).
HTH.
Regards,
Ilya