Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I drop it?
Message
De
02/12/2013 15:00:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
02/12/2013 09:45:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01588891
Message ID:
01589082
Vues:
74
>I support 100% long and descriptive Procedure/Class/Method/Variable names in vfp but I am
>AGAINST using long field names in VFP. For simply practical reasons nothing else.
>Who ever used/uses local cursors extensively, must have already or sooner/later WILL experience
>one problem or another. As you sure know, long table names are latecomers in xbase / VFP world, so I am not sure that
>all VFP commands/functions are 100% updated/debugged to properly process them.
>Create Cursor / alter table alias() is one example.

Create cursor is not - it's only alter table, and I usually think there's something wrong with the source cursor if you need another one with a few fields less. Ulness it's something to be exported anyway, but in that case I probably need to reformat some of the fields anyway, so a custom select with sevaral ", cast(someFunc(fieldA) as C(100)) as reformattedFieldA, ..." is due anyway. I use a modified versions of intellisense script posted here (or on the wiki) by Frank Dietrich to compose a fieldlist - and then it's just a matter of deleting what I don't need and editing what I do.

Most of my cursors are SPT anyway, and they come with source fieldnames as long as you like.

>I had few other problems with them as well, but cannot exactly remember context.
>However I am sure there are more. Perhaps our more experienced/knowledgeable VFP community members
>can list out few more commands/contexts where you will run into problems with long field names.

Export to fox2x tables, of course. And sometimes building a dbf with more than 200 long fieldnames may yield a Create Table command which is too long to be compiled. For a while I was maintaining a version of something like gendbc where in such cases it would dimension and populate an array of the structure required for "create table ... from array". The code was much longer than the simple "create table (...)" command, but it compiled and worked.

>Do you think that using field names longer then 10 chars is wise thing to do ?

Since we all pretty much use English, the language of ambiguity (or, as the moderator on xkcd forum said "no ambiguity - it has all the tools to avoid it" - ah, so it needed those tools, I wonder why), the field names need to be long enough to avoid it. Plus give it some prefixes - the xxx_field notation has saved my butt many times - you'd be left with just six characters. Now imagine you had a slightly denormalized table, with (even unprefixed) homephone1, homephone2... what do you do when you reach ten of them? And then consider the number of words which just can't be abbreviated if you want to remember what they mean in a couple of weeks. I've seen things like "del", "delete" on a boolean field - what does it mean, that it was deleted or that it can be deleted. If i's a verb, why isn't it "deleted"? Or "smthinComp" - comp as in complicated, comparative, compound, composite, complex, computer, composer, compost, compote, complete, compressed...?

I remember having a field called "vrana" (srb. crow)... took me some time to remember it was "vrsta analitike" (type of analytics). Or "sumpor" (sulphur) - suma poreza (tax total).

Nowadays I'm happy to be verbose. Don't have the time to write shorter (Voltaire?).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform