Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi Houston.
>When it comes to indicating data type, why should field names be any less appropriate than variables (and in my case properties)?
I don't think it's inappropriate; I just consider it unnecessary. In the case of variables and object properties, there's no way to know what type of data can be stored in them, so a naming convention tells other developers (and yourself <g>) what data type to use and expect since VFP won't give an error when you try to store the wrong data type to a value or custom property. However, in the case of a field, doing something REPLACE COMPANY WITH 5 will result in an error if COMPANY is Character. Also, if I need to check the data type of a field in a table, it takes about 5 seconds to USE and DISP STRU.
Of course, I certainly wouldn't suggest that someone stop using such a convention if they're comfortable using it. I just personally haven't needed such a convention in my 20 years of development experience.
Doug
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement