Isn't it interesting how we all view things differently.....

> I don't use the prefix style of naming. Like you I like to be able to 
> *read* the code and most of the time I don't need to know the type of a 
> variable, especially with CF's fairly weak typing.

My argument for using prefixes (not necessarily "Hungarian" but in some 
form) in Cold Fusion is BECAUSE it is weakly typed.

The theory goes like this.....

In a strongly typed language like C++ I am forced to declare all the types 
of my variables before I can use them.  Then, when I do use them, if I 
don't use them in the correct context, the compiler will scream, whinge, 
bitch and moan because I always run it in strict mode.  It means that by 
the time my code compiles I KNOW that all the data types are correct and I 
haven't made any mistakes.  Even when I have cast variables to co-erce 
them into the right state, I still know they are "right" because the 
language can enforce it.

However, in Cold Fusion a variable can accidently change it's type by the 
time it gets to other places in the code.  Therefore, my argument for 
embedded "type" into the variable names is so that you can have a team 
working on code and can pick up on what the intended use of a variable is.

Things like complex variabels (structure, arrays, objects) benefit best 
from this because you dont want to have to use IsStruct everywhere before 
you use a variable.

I find it comes more into play during maintenance than during development. 
 You can point someone at some code they have never worked on before and 
be reasonably sure they will use the variables in the correct way.




Gary Menzel
Web Development Manager
IT Operations Brisbane -+- ABN AMRO Morgans Limited
Level 29, 123 Eagle Street BRISBANE QLD 4000
PH: 07 333 44 828  FX:  07 3834 0828


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to