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 15:45:48
 
 
À
02/09/1997 19:47:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00048156
Message ID:
00048347
Vues:
24
As one of those from the dark ages, I've been wondering who done it. Personally, I LIKE the fact that Fox is not a strongly typed language. There is very little that torques me off more than cranking along in C and need to do some debugging and throw some debugging variables in a forget to 'predefine' them.

Secondly, being an old Fortran'er (everything described in 8 letters or less), the prefixes just clutter up the variable names. Again, I'm voicing (typing) my opinion here, but if the code is so bleedin' convoluted that you can't figure out WHAT a variable is, you got bigger problems and an lc (or whatever) in front of the names won't help.

And lastly, being someone who believes that the '_' character is a freakin' waste of a keystroke, WHY add more? The fact that I can type at 120-150 wpm is NOT a sign that I like typing. I type fast because I hate typing code!

Sorry for the outburst, but I just got through spending about a week trying to 1) figure out WHAT 'pbIsMonthToDate' was, and where it was being defined.

>Hold tight...
>
>This message contains sacrilege - VIEWER DISCRETION IS ADVISED
>
>VFP is NO PLACE FOR HUNGARIAN NOTATION! There, I've said it! (pinch reveal me to be still living).
>
>For those of you in the very dark ages, "Hungarian notation" (don't know where the name comes from) 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??
>
>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!
>
>So WHY DO WE NAME OUR PROPERTIES with HUNGARIAN NOTATION??? There simply is no good reason for doing so with VFP.
>
>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???
>
>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.
>
>Comments anyone??
>
>Jim (the heretic) N
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform