Practical Standards for Microsoft Visual Basic .NET (Pro-Developer)

[Previous] [Next]

One of the earliest methods of distinguishing data types was the use of Basic's data type suffixes. A data type suffix is a symbol representing a specific data type. You append these symbols to the ends of variable names. For instance, the type suffix for the String data type is the dollar sign ($). Using suffixes, you can create variable names such as FirstName$ and Address$ . Type suffixes have a number of drawbacks. The most apparent is that the suffixes aren't always intuitive. Do you know (or can you determine) the corresponding data types for these suffixes: %, &, !, and #? They are Integer, Long, Single, and Double, respectively. The difficulty of remembering type suffixes might not be enough reason to reject the convention. However, consider these variables :

Handles are actually Long integers. Reducing both of these variables to Send& doesn't help you to distinguish between the two.

Категории