Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joel on Software
Message
From
17/05/2005 15:30:36
John Baird
Coatesville, Pennsylvania, United States
 
 
To
17/05/2005 15:18:47
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01014573
Message ID:
01015061
Views:
31
How sad, Mr. Contrarian
as well as septugenarian
I'd like to bet
that you really forget
That real programmers use Hungarian.



>>AccountNumber and AccountNo? You could keep those straight and remember which is which? You're a better man that I, Gunga Din.
>
>Easy as pie... "...Number" means numeric and anything else implying a number, like "No" or "Num", means it's definitely not a numeric. We can do things like this now that we have more than 10 characters available.
>
>Neither could be mistaken for a logical because the code would read something like 'NeedAccountNo' or 'HaveAccountNumber' or 'Got AccountNo', etc.
>
>
>>
>>>I don't use "Hungarian" but I have a simple personal rule for your example... your lnAccountNumber would be AccountNumber and you lcAccountNumber would be AccountNo.
>>>
>>>Works nicely for me.
>>>
>>>In general I prefer to type descriptive names than use prefixes.
>>>
>>>cheers
>>>
>>>>Let me give you an example. Don't you find lcAccountNumber and lnAccountNumber more useful names than AccountNumber? I think the disctinction is MORE important in a weakly typed language like xBASE. xBASE is downright diabolical in letting you instantiate variables willy-nilly, no type defined, even letting you change type by assigning a different constant, and then expecting certain parameter types at run time. Kaboom!
>>>>
>>>>Mike
>>>>
>>>>
>>>>>Hungarian notation was invented for the C programming language. It has its great value in strong (strict) typed languages has you carefully have to match types. In weak (dynamic) typed languages it is less important, casting from double to int to numeric is done automatically: there is less need to be aware of the exact type. In VFP we have only: character, boolean, numeric, date, datetime and object as base types. Therefore there is less technical need to distinguis between derived types like int, float, double and memo and text.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform