General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only