Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX
Message
From
03/05/2000 22:54:51
 
 
To
03/05/2000 22:31:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00365597
Message ID:
00365932
Views:
27
John, et al,

What about coming up with some kind of "mix" of mnemonic and value definition?

For example, MB_YESNO could perhaps become something like MB_YESNO_4...

Don't know how workable that would be but just a thought...

Best,

DD

>Ding ding ding! We have a winner......
>
>This is exactly my reasoning. IMHO, it's just as hard for me to remember MB_YESNO as it is the number 4 too.
>
>
>>I know and acknowledge all of the textbook reasons to use DEFINEs. Steve McConnel states that "magic numbers" are always a no-no. A magic number is any hardcoded numeric literal whose number is arbitrary. IOW, the only numbers you should have in your code are like 1 for a loop, or 2 for an array dimension. All others are bad. I agree.
>>
>>BUUUUUUUT. The practical issues involved with littering your code with constants make the practice unbearable, IMO. At least in VFP. VFP is extremely goofy with regard to the "scope" of an include file, and its behavior with constants in the debugger, and its sometimes mysterious tendency to forget where include files are. As a result of these PITAs, I almost never use defined constants.
Best,


DD

A man is no fool who gives up that which he cannot keep for that which he cannot lose.
Everything I don't understand must be easy!
The difficulty of any task is measured by the capacity of the agent performing the work.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform