Saturday 22 October 2016

Interface Naming Conventions


At an earlier crossing on my development journey, many moons ago, it was considered best practice to use the “Hungarian Notation” for variables. You basically prefixed every variable name with a code denoting the data type that variable contained. This resulted in variable names like strName (a string) or u32Number (a 32-bit unsigned integer). The reason why this was considered best practice was that you were dealing with low-level languages that were pretty literal when given commands by the developer. So, if you had a 32-bit variable, 32 bits of memory were reserved to contain the contents of that variable. If you copied the contents of a different 64-bit variable into that first one, the language would just allow you to do that… writing 32 bits of information into your variable and the remaining 32 bits into whatever happened to be stored immediately behind that allocated spot in the memory. You can be sure that that often resulted in very random bugs, being anything from spectacular to completely undetected until shipped. Take a look at the list of Types of Memory Errors for a nice catalog of memory abuse options.
So, with these languages, it was pretty much necessary
Source: https://managewp.org/articles/13680/interface-naming-conventions




source https://williechiu40.wordpress.com/2016/10/22/interface-naming-conventions/

No comments:

Post a Comment