Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX
Message
From
04/05/2000 00:36:14
 
 
To
03/05/2000 23:15:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00365597
Message ID:
00365951
Views:
15
Bill,

Ahh.. I can see what you're getting at. Dang... <g>

Best,

DD



>Hi Doug,
>
>PFMJI
>
>>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...
>
>I see the limitation with this as what happens when the constant changes (maybe not a system defined one, but certainly possible in your own headers) so...
>#DEFINE MY_MEANINGFUL_ABSTRACTION_4       4
>Becomes:
>#DEFINE MY_MEANINGFUL_ABSTRACTION_4       64  &&name no longer meaningful
>...for some reason, and the whole abstraction is lost.
>
>As per the reference Erik alluded to and others, the main advantages of Named constants like these are the abstraction and decoupling of the actual value from where it is reference (sort of an encapsulation), and the increased code documentation, rather than the ease of rememberance that everyone is saying.
>
>I have been trying them a lot lately(but then I just read Code Complete *s*) and I have been seeing the limitations that Erik mentioned, but I am finding that defining a .h for each class, giving the .h a standard structure, and using them consistently has worked well so far.
>
>>Don't know how workable that would be but just a thought...
>Same here, just thought I would state what I saw as a limitation of that idea.
>
>Later,
>Bill
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
Reply
Map
View

Click here to load this message in the networking platform