Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Standards
Message
From
29/09/2003 23:40:46
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
29/09/2003 14:10:17
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
COMCodebook
Title:
Miscellaneous
Thread ID:
00832733
Message ID:
00833366
Views:
40
Walter

First please understand I have no negative feelings as I write this. I'm writing this with the feeling I have for a chess game. It is an enjoyable intellectual puzzle.

It seems you are saying there is no such thing as a standard in VFP. I agree. There are simply far too many conventions. Readability is only what a person has gotten used to. You admitted there is a difference with using mdot on the right side of the equal sign. You admitted that performance is adversely affected by the number of fields in the table in the current work area. You even mentioned it in this very thread. You didn't say anything about how code that doesn't use mdot can be broken just by adding a single field to a single table. You cannot control who will inherit your systems, but you can make sure they can't break your code.

This code...
LOCAL ok
ok = 1
IF ok = 1
  ?"Hi Walter"
ENDIF
will crash if I open a table with a field named ok with a logical data type.

Many say use hungarian notation to avoid this. Fine!
LOCAL lnOK
lnOK = 1
IF lnOK = 1
  ?"Hi Walter"
ENDIF
This will crash if someone adds a logical field called lnOK to a table and runs this code. There is a simple, effective, performance enhancing, foolproof solution!

A single mdot makes the code faster when no table is open. It is even faster when a table with a lot of fields is open. There is never a loss of performance using mdots. Furthermore, the code will not crash for any outside reason! No one has ever shown a reason not to use mdots. Some choose to write the following code by putting the mdots everywhere. That is redundant, unnecessary / wasteful and slower. If one does that, I hope they do it with the knowledge that it is not the optimal way. To the best of my knowledge, with everyone I've ever confronted with this failing to find physical evidence against it, this is the best way to use mdots:
LOCAL lnOK
lnOK = 1
IF m.lnOK = 1
  ?"Hi Walter"
ENDIF
You said we should know when to use macrosubstitution. I argue we should know when and how to use everything. That includes DELETED() tags, SPT or Views. You argue that Craig's examples are just his opinion. I think I explained all the reasons for using mdots. You even duplicated my findings and expressed surprise.

With respect and no intention to insult you, Walter, I remind you that you told me you wouldn't use the mdots because of readability. That made me think you are saying my way is not "readable", as if "readable" is some global standard you invented. On the issue of mdots, given a choice between having stable code and having readable code, I choose stable. The mdots don't reduce readability as much as they improve stability. Once you get used to them, it is easy. Isn't this what Peter meant when he said, we should teach the good techniques, but we should be able to adopt new techniques when they are demonstrated?

I think you should not be so hard on Craig until you agree that you should use mdots everywhere (properly of course) because you used the same arguements against Craig that I used on you <g>.

Hopefully, this will neither anger nor frustrate you.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform