Tom Muck

Alpha Dog Blues Band
Home page
All articles
All Extensions | Extension News | Extension FAQs | Customer Login
Books authored or co-authored by Tom Muck
Extensions, books, and other products | Customer Login
Your current cart contents Blog | CMXTraneous Blog | Flash Remoting Blog
About the site


Tom Muck's BlogTom Muck's Blog

News and Views

Macromedia variable and function names

Monday, June 20, 2005 6:34:56 PM

I got an interesting support question today: it was about the use of variable names in my extensions. The user was saying that there was a name conflict because he was using the name MM_rs in his code and it conflicted with a variable that Dreamweaver was using (via the Recordset Navigation Suite). It occured to me that it might not be clear why certain variables are named as they are.

Macromedia uses the naming convention MM_ at the front of their variables and functions. This is a naming convention that is supposed to reduce support problems because it is a name that a typical user would not use. Since Macromedia's code is built for distribution and may be used by many different users, variable name conflicts could easily occur. In other words, if Macromedia named a variable temp, it might conflict with a variable that a user sets up named temp. However, MM_temp is not likely to conflict with a user's variable name. However, this user wanted to keep his names consistent and decided to prefix everything with MM_.

As far as I know, this is not really documented anywhere, however, and is just "common knowledge" among programmers who use Dreamweaver. Similarly, I typically prefix my variables with tfm_ so that they won't conflict. Massimo uses tmt_, and other programmers use other typical prefixes. It is usually not something I do in my own code, but if I think I'm going to distribute code in an extension or as a code snippet, I use the prefix.

Category tags: Macromedia/Adobe, Dreamweaver, ColdFusion

Before posting comments or trackbacks, please read the posting policy.

Full Blog Calendar

Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
About | Privacy Policy | Contact | License Agreement | ©2002-2023 Tom Muck | Dreamweaver Extensions