Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
 
 
To
25/10/2006 13:46:35
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164499
Views:
9
Walter,

>1. Actually it might bite you as well. E.g:
>
#DEFINE MYSTRING "This is a very long string of a few hundred characters long ....."
>IF you use this instead of a variable, it ends up as many times you use the contant, consuming more memory than when using variables.

That consumes more memory, it doesn't consume memvars. And yes, I'd call the above #define abuse. *g*

>2. As for runtime execution speed. I don't think that anyone would take that seriously for only a very few performance critical routines. You can of course prove the difference, but how many value has this have in practise

Whether or not it's a "measurable" amount of time depends on how many constant variables are being set up. If the couple of thousand Word constant memvars are all being created. And yes correspondingly huge .h files do take longer to compile, but the enduser doesn't experience that time just us poor slob programmers.

>, while about every VFP programmer has difficulty to get their database performance over the network under control.

Certainly there are other more time consuming things that go on in our apps.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform