Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hungarian Notation cost you too much in VFP
Message
De
03/09/1997 11:40:08
 
 
À
03/09/1997 08:30:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00048156
Message ID:
00048296
Vues:
50
Himself!

BB


>So, who invented the Hungarian notation? Him or his father?
>
>Vlad
>
>>Hi Vlad and other!
>>
>>Here is a Hungarian man about Hungarian notation.
>>So Charles Simonyi as I know creates the NT at MS. His father was well known author and academic in Hungary. (I learnt from his book at TechUniv Budapest)
>>
>>BB
>>
>>
>>
>>>>For those of you in the very dark ages, "Hungarian notation" (don't know where the name comes from)
>>>
>>>It comes from its creator, Charles Simonyi, who is Hungarian. If I'm wrong, please, anyone, correct me.
>>>
>>>>is a 'coding style' where identifiers are PREFIXed by short and specifc letters to denote specific things. These usually (always, to the devout practitioner) "tell" the reader the SCOPE of the variable named and the TYPE of said variable. So, for instance, lcCust has "lc" prefixing Cust, and "l" says it is a local variable and "c" says it is a character variable. Kool!
>>>>
>>>>And it was real cool, all the way through FPD and FPW. But it is totally UNcool in VFP!
>>>>
>>>>Have you noticed that MS recommends the use of Hungarian notation in the docs for VFP 3.0?
>>>>
>>>>BUT, have you noticed that MS doe *NOT* take their own advice - they do *NOT* call their properties cFontName or nFontSize or lFontBold or. . . Why do you suppose this is??
>>>
>>>If I would write down all the nonconformities in MS' docs, I will probably have more doc than... But, as long as I understand these docs and samples, it's ok. Sure, I would like a more precise terminology (both in definitions and use).
>>>
>>>>Well, it is because doing so would really gum things up for you and me. Imagine trying to find all of the references or properties for FONTS in the Help if you had to enter "cfont" AND "lfont" and "nfont" and... just to find them. Imagine if the properties/events/methods "box" had some FONT properties under cfont..... and some under ifont..... and some under lfont..... and some.......! Do the same with all of the other properties and see what a mess you end up with!
>>>
>>>You have your point here.
>>>
>>>>So WHY DO WE NAME OUR PROPERTIES with HUNGARIAN NOTATION??? There simply is no good reason for doing so with VFP.
>>>
>>>1st good reason: When working in a team, the Hungarian notation is invaluable. It provides implicit doc for variable/property/function types. Using this notation cuts down dramatically the development time (you don't need to search in docs to find the type for each variable, etc) and the debugging time (the number of errors caused by type mismatch...). The same applies also for one man workshop when dealing with old or legagy apps.
>>>
>>>2nd g.r.: VFP does not provide type declarations, thus, the compiler cannot verify the type correctness. This is very good in many situations, but in the same time it is a big draw back on the development time (the programmer must verify this very carefully).
>>>
>>>>1) VFP now allows LONG variable names (up to 120 chars for all except free table field names)
>>>>
>>>>2) VFP has LOTS of *SORTED* lists throughout its development environment.
>>>>
>>>>Why not use a SUFFIX instead of a prefix???
>>>
>>>Nobody stops you from doing this and its a good idea in fact. The only disadvantage I see: it's not generally accepted.
>>>
>>>>The SUFFIX WOULD DO EXACTLY THE SAME "JOB" AS THE PREFIX (of Hungarian notation) BUT all lists would be in a readable, sensible, CLEAR order which makes for better, cleaner code.
>>>
>>>As said, it looks like a very good idea.
>>>
>>>Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform