Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why define constants
Message
From
25/10/2006 11:10:06
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01164235
Message ID:
01164402
Views:
12
SNIP
>>
>>I surprise you because I find #DEFINE to be troublesome???
>
>No, not cos of DEFINE but of the concept of "one-stop" definitions, which I thougfht you were decrying. Hmmm, you can put var definitions in the code but they'd need to be in every bit of code that uses them. e.g. the "no disk in" err mess might need to be shown in many parts of the suite. To get round that you could define the "defines" as globals, but isn't that frowned upon?

I don't use PUBLICs unless totally unavoidable.
In my judgement "one stop definitions" done using #DEFINE are more troublesome than they have value.
They also impose crappy coding requirements (ALL CAPS SEEMS TO BE THE NORM and prefixes like MB_ to prevent accidental usage of the same as a variable or field name) which **in my opinion** detract from code quality.
And these external files have to be managed/maintained and it must not be forgotten to add references to them in new code. Just another avoidable headache, as far as I'm concerned.

>
>>I avoid "Hungarian notation" too, when I can. what does that say about me????
>
>Who says that defined values have to be in Hungarian?

See above. Special things have to be done to preclude problems. But my point was a tad different - if you are surprised that I don't like #DEFINEs you must be shocked that I abhor Hungarian < s >.

>
>>I deliberately code 'extraneous' things (like "ALL" with SCAN for example and use IF...ELSE...ENDIF in many cases where IIF(... would work nicely) in the belief that it helps make code clearer to later readers. Surprised?
>
>What's that got to do with this subject. And no, that doesn't surprise me any motre than the fact that I avoid needless short-cuts in code for better, later readability. (e.g. I abhor the use of "!" for "NOT", "#" for "<>")

What it's got to do with the subject is that **in my opinion** #DEFINEs have impact on readability just as much as these other things do.

cheers
>
>
>>cheers
Previous
Reply
Map
View

Click here to load this message in the networking platform