The real benefit to marking parameters is when you use variables within a
function that are defined outside the function.  You could make an argument
that it's poor practice to do so, but there it is.  I guess you could prefix
every other kind of variable instead.  Also, when you are choosing names for
your parameters marking them with some universal prefix is an easy way to
avoid naming collisions.

Does anyone really port ActionScript to PHP and Perl or did you just mean
working in both languages individually?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Keesey
Sent: Friday, August 18, 2006 8:25 PM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] vars with $

I have seen others do it, or mark parameters with a "p_".

I prefer not to mark parameters in any special way. I mark private
variables with "_", so those are already distinct. And if I have a
function that's so long that I can't see the top from somewhere in the
body, it's well past time to cut it down into more manageable chunks.

Plus, using "$" makes it more confusing when switching between PHP or
Perl (or another language that uses "$" to mark all variables) and
ActionScript.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom Lee
Sent: Friday, August 18, 2006 1:38 PM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] vars with $

I've used it to indicate arguments in a function to clarify the origin
of
the variable, like this:

function myFunc($arg1,$arg2){
        trace($arg1+" : "+$arg2);
}

I don't know where I picked that up, but for me it makes the code easier
to
read since you know immediately they are arguments.  I've seen people
use
the underscore for the same purpose, but that can confuse things since
ActionScript uses that for some native properties (_x,_y).

Does anyone else do this, or am I just in my own little universe?


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to