Re: [Flashcoders] Freelancer Class

2006-11-08 Thread Weyert de Boer

I think this keyword rks vworkery nicely.
___
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


RE: [Flashcoders] Freelancer Class

2006-11-08 Thread Mike Keesey
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Dennis Roche
> Sent: Tuesday, November 07, 2006 10:47 PM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] Freelancer Class
> 
> I prefer the the double underscore naming scheme to differentiate a
> local/arugment variable from a class variable. It helps when you want
to
> create get/set functions and reminds you that it is a private variable
and
> should not accessed directly.
> 
> class Student
> {
>private var __name:String;
>public function Student(name:String)
>{
>   __name = name;
>}
> }

Me, too (well, single underscore), but we were talking about setting
properties, not variables. You might want to set a property in a field
because it has some kind of verification or formatting functionality.
For example:

class mypackage.MyClass {
/**
 * Class constructor.
 *
 * @param   nameName for this instance.
 * @see #name
 */
public function MyClass(name:String) {
this.name = name;
}
/**
 * An upper-case string which is the name for this instance.
 *
 * Values are automatically converted to upper-case. May be
 * [EMAIL PROTECTED] null}.
 */
public function get name():String {
return _name;
}
public function set name(value:String):Void {
if (value instanceof String) {
_name = value.toUpperCase();
} else {
_name = null;
}
}
private var _name:String = null;
}


―
Mike Keesey


___
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


RE: [Flashcoders] Freelancer Class

2006-11-08 Thread Steven Sacks | BLITZ
I don't like anything that puts arbitrary constraints on my code.  Ruby
on Rails has fantastic naming conventions but they have very clear
benefits.  Also, they use @foo for instance variable names and @@foo for
class variable names.  Unfortunately, they don't use braces to contain
functions and classes and that makes kittens cry.
___
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


Re: [Flashcoders] Freelancer Class

2006-11-08 Thread Ian Thomas

Hi Jim,
 Not target at you particularly; just that as I say, every couple of
months the same thing rolls by. :-)

Anyway; I'm just adding noise, so I'll shut up now.

Ian

On 11/8/06, jim <[EMAIL PROTECTED]> wrote:

Yeah, I joined the conversation late. I have a habit of not reading mail for
a few days and going from the bottom of the pile up, so I will replay to a
mail on this list only to go a little further up the pile to see exactly the
same comment from someone else.

Sorry.
Jim

___
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


RE: [Flashcoders] Freelancer Class

2006-11-08 Thread jim
Yeah, I joined the conversation late. I have a habit of not reading mail for
a few days and going from the bottom of the pile up, so I will replay to a
mail on this list only to go a little further up the pile to see exactly the
same comment from someone else.

Sorry.
Jim

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas
Sent: 08 November 2006 13:11
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Freelancer Class

Sometimes I really wish the language enforced a particular way of
naming methods and properties; if only because then we wouldn't have
exactly the same conversation posted on this list every couple of
months. :-)

Ian

On 11/8/06, jim <[EMAIL PROTECTED]> wrote:
> I prefer having the this. On the beginning of all calls to properties in a
> class so that I can easily see what is class level & what is method level.
> It works without but I feel happier reading it that way.
>
> Jim
___
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


RE: [Flashcoders] Freelancer Class

2006-11-08 Thread jim
This is a recognized way of initializing a class, you can call them
different things, but if they are the same thing why give them different
names? The this keyword tells you exactly what is going on. I don't think
its bad code.

Just my opinion.
Jim

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
| BLITZ
Sent: 07 November 2006 20:05
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Freelancer Class

> I don't know if it's a remnant.
> 
> You may be doing property initialization and need to nail down scope:
> 
> class Student {
> 
> private var name:String
> 
> function Student( name:String ) {
>this.name = name;
> }
> }

That's just bad coding.  Don't use class variable names as argument
names.  It's not like you don't have a choice about it.  ;)
___
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


RE: [Flashcoders] Freelancer Class

2006-11-08 Thread jim
Looks like I joined this argument a bit late, sorry for rehashing the same
points.

Jim

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of jim
Sent: 08 November 2006 13:08
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] Freelancer Class

I prefer having the this. On the beginning of all calls to properties in a
class so that I can easily see what is class level & what is method level.
It works without but I feel happier reading it that way. 

Jim

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
| BLITZ
Sent: 07 November 2006 19:29
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Freelancer Class

> I know I don't have to.
> But I think the code is more clear that way.

Classes will not compile if you try to access variables that are not
declared in the class.  So by accessing a variable, it is inherently
referring to "this" because it absolutely must be, thus that particular
use of "this" is redundant and a remnant of the days of AS1 classes
(prototype) and maintaining scope within them.  

That's not to say "this" doesn't have its place, but since its place is
more refined now, I find it's more important to reserve its use for
those times so it stands out that much more.  However, everyone has
their own style and if using "this" gives you warm fuzzies, then who am
I or anyone to take that away from you?  :)
___
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

___
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


Re: [Flashcoders] Freelancer Class

2006-11-08 Thread Ian Thomas

Sometimes I really wish the language enforced a particular way of
naming methods and properties; if only because then we wouldn't have
exactly the same conversation posted on this list every couple of
months. :-)

Ian

On 11/8/06, jim <[EMAIL PROTECTED]> wrote:

I prefer having the this. On the beginning of all calls to properties in a
class so that I can easily see what is class level & what is method level.
It works without but I feel happier reading it that way.

Jim

___
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


RE: [Flashcoders] Freelancer Class

2006-11-08 Thread jim
I prefer having the this. On the beginning of all calls to properties in a
class so that I can easily see what is class level & what is method level.
It works without but I feel happier reading it that way. 

Jim

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
| BLITZ
Sent: 07 November 2006 19:29
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Freelancer Class

> I know I don't have to.
> But I think the code is more clear that way.

Classes will not compile if you try to access variables that are not
declared in the class.  So by accessing a variable, it is inherently
referring to "this" because it absolutely must be, thus that particular
use of "this" is redundant and a remnant of the days of AS1 classes
(prototype) and maintaining scope within them.  

That's not to say "this" doesn't have its place, but since its place is
more refined now, I find it's more important to reserve its use for
those times so it stands out that much more.  However, everyone has
their own style and if using "this" gives you warm fuzzies, then who am
I or anyone to take that away from you?  :)
___
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


Re: [Flashcoders] Freelancer Class

2006-11-08 Thread Alias™

Unless

You are passing a function into a newly created object and need to
explicityle refer to the object that it is passed into.

..inside class

var myFunction:Function = new Function(){
this.a = 2;
this.b = 5;
this.c = this.a + this.b;
}

var newObj = new Object();
newObj.onLoad = myFunction;

..class continues

Then you have to use "this".

Just sayin'.

HTH
Alias

On 07/11/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:


> I know I don't have to.
> But I think the code is more clear that way.

Classes will not compile if you try to access variables that are not
declared in the class.  So by accessing a variable, it is inherently
referring to "this" because it absolutely must be, thus that particular
use of "this" is redundant and a remnant of the days of AS1 classes
(prototype) and maintaining scope within them.

That's not to say "this" doesn't have its place, but since its place is
more refined now, I find it's more important to reserve its use for
those times so it stands out that much more.  However, everyone has
their own style and if using "this" gives you warm fuzzies, then who am
I or anyone to take that away from you?  :)
___
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


Re: [Flashcoders] Freelancer Class

2006-11-08 Thread Cedric Muller

one nice thing would be to add a '_p' (for param) suffix

function Student (name_p:String) {
this.name = name_p;
}




-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ
Sent: Tuesday, November 07, 2006 12:05 PM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Freelancer Class


I don't know if it's a remnant.

You may be doing property initialization and need to nail down

scope:


class Student {

private var name:String

function Student( name:String ) {
   this.name = name;
}
}


That's just bad coding.  Don't use class variable names as argument
names.  It's not like you don't have a choice about it.  ;)


I don't think it's "bad" coding. Documentation generated from this
signature might be a bit clearer than documentation generated from a
signature where the argument was, e.g., "nameValue", since it would be
more immediately obvious that the argument "name" corresponds to the
property "name". That said, the code itself is clearer the other way.
Six of one and half a dozen of the other. (Programming is so often  
like

that.)

--
Mike Keesey

___
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


Re: [Flashcoders] Freelancer Class

2006-11-07 Thread Dennis Roche

On 08/11/06, Mike Keesey <[EMAIL PROTECTED]> wrote:


> That's just bad coding.  Don't use class variable names as argument
> names.  It's not like you don't have a choice about it.  ;)

I don't think it's "bad" coding. Documentation generated from this
signature might be a bit clearer than documentation generated from a
signature where the argument was, e.g., "nameValue", since it would be
more immediately obvious that the argument "name" corresponds to the
property "name". That said, the code itself is clearer the other way.
Six of one and half a dozen of the other. (Programming is so often like
that.)

--
Mike Keesey



I prefer the the double underscore naming scheme to differentiate a
local/arugment variable from a class variable. It helps when you want to
create get/set functions and reminds you that it is a private variable and
should not accessed directly.

class Student
{
  private var __name:String;
  public function Student(name:String)
  {
 __name = name;
  }
}


--
Go Dennis!
___
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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Steven Sacks | BLITZ
> They (now Adobe) have pretty much done an about-face on this 
> issue. The ActionScript 3.0 documentation 
> (http://livedocs.macromedia.com/flex/2/langref/ ) is excellent.

Macromedia's AS docs were (in)famously bad due to what many considered
to be poor examples and they also had many errors.  I believe they have
field developers writing the docs for AS3 now so expect the examples to
be more applicable and hopefully the error count will be a lot lower, as
well.


> And they do use the argument name = property name syntax in
constructors.

There's more than one way to skin a cat.  While I might find that
cutting from the base of the neck down the back to the base of the tail
to be the best way, others might prefer cutting along the belly better
because the stitching will be less visible once you put the skin back
together even though cutting from the belly often results in a mess
unless you're careful.  Different strokes for different folks.
___
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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Steven Sacks | BLITZ
I shouldn't have used the term "bad" to describe these practices and for
that I apologize.

My eyes see all those extra "this" references as clutter and some
people's eyes see them as useful pointers.  I don't use document writing
programs like AsDoc or Jdoc so the concerns of people who do are foreign
to me.  I wasn't even aware of their constraints in this regard and so
to automatically declare them as "bad" was my bad.  :)
___
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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Sönke Rohde
> > I don't know if it's a remnant.
> > 
> > You may be doing property initialization and need to nail 
> down scope:
> > 
> > class Student {
> > 
> > private var name:String
> > 
> > function Student( name:String ) {
> >this.name = name;
> > }
> > }
> 
> That's just bad coding.  Don't use class variable names as argument
> names.  It's not like you don't have a choice about it.  ;)

Sorry, but I completly disagree. I think this is best practice.
The usage of this is obsolete in many cases but with "this" it is clear that
it is a member variable.
I also use ClassName.staticVarName to ensure that it is a static variable.
This kind of coding will be completly obsolute if IDEs support semantic
syntax highlighting to show difference between member- static and local
variables like it is already supported by the latest JDT.

Cheers,
Sönke

___
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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Mike Keesey
They (now Adobe) have pretty much done an about-face on this issue. The
ActionScript 3.0 documentation
(http://livedocs.macromedia.com/flex/2/langref/ ) is excellent.

And they do use the argument name = property name syntax in
constructors. For example,

http://livedocs.macromedia.com/flex/2/langref/Error.html

Error(message:String = "", id:int = 0)
Creates a new Error object.

(Well, the "id" argument corresponds to the "errorID" property--so I
guess they went both ways on this one!)
―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ
> Sent: Tuesday, November 07, 2006 1:34 PM
> To: Flashcoders mailing list
> Subject: RE: [Flashcoders] Freelancer Class
> 
> > Pretty much. You either muddy up your code or your docs.
> 
> I opt to muddy up docs over code, just like Macromedia.  ;)
> ___
> 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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Steven Sacks | BLITZ
> Pretty much. You either muddy up your code or your docs.

I opt to muddy up docs over code, just like Macromedia.  ;)
___
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


Re: [Flashcoders] Freelancer Class

2006-11-07 Thread slangeberg


I don't think it's "bad" coding. Documentation generated from this
signature might be a bit clearer than documentation generated from a
signature where the argument was, e.g., "nameValue", since it would be
more immediately obvious that the argument "name" corresponds to the
property "name". That said, the code itself is clearer the other way.
Six of one and half a dozen of the other. (Programming is so often like
that.)



Pretty much. You either muddy up your code or your docs. This is probably
why this kind of code is prevalent in Java. They've had strong doc tools
nearly from the beginning.

Scott

On 11/7/06, Mike Keesey <[EMAIL PROTECTED]> wrote:


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ
> Sent: Tuesday, November 07, 2006 12:05 PM
> To: Flashcoders mailing list
> Subject: RE: [Flashcoders] Freelancer Class
>
> > I don't know if it's a remnant.
> >
> > You may be doing property initialization and need to nail down
scope:
> >
> > class Student {
> >
> > private var name:String
> >
> > function Student( name:String ) {
> >this.name = name;
> > }
> > }
>
> That's just bad coding.  Don't use class variable names as argument
> names.  It's not like you don't have a choice about it.  ;)

I don't think it's "bad" coding. Documentation generated from this
signature might be a bit clearer than documentation generated from a
signature where the argument was, e.g., "nameValue", since it would be
more immediately obvious that the argument "name" corresponds to the
property "name". That said, the code itself is clearer the other way.
Six of one and half a dozen of the other. (Programming is so often like
that.)

--
Mike Keesey

___
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





--

: : ) Scott
___
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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Mike Keesey
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ
> Sent: Tuesday, November 07, 2006 12:05 PM
> To: Flashcoders mailing list
> Subject: RE: [Flashcoders] Freelancer Class
> 
> > I don't know if it's a remnant.
> >
> > You may be doing property initialization and need to nail down
scope:
> >
> > class Student {
> >
> > private var name:String
> >
> > function Student( name:String ) {
> >this.name = name;
> > }
> > }
> 
> That's just bad coding.  Don't use class variable names as argument
> names.  It's not like you don't have a choice about it.  ;)

I don't think it's "bad" coding. Documentation generated from this
signature might be a bit clearer than documentation generated from a
signature where the argument was, e.g., "nameValue", since it would be
more immediately obvious that the argument "name" corresponds to the
property "name". That said, the code itself is clearer the other way.
Six of one and half a dozen of the other. (Programming is so often like
that.)

--
Mike Keesey

___
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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Mike Keesey
That's one instance where I use it; and also (of course) if you have to
pass "this" as an argument (e.g., to Delegate.create). In a few cases in
ActionScript 2.0 it's needed to disambiguate top-level and MovieClip
functions that have the same name. (Thankfully, they fixed this in
AS3.0.) Other than that, I think it tends to clutter things up.

But that's just my take.

―
Mike Keesey

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of slangeberg
> Sent: Tuesday, November 07, 2006 11:47 AM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] Freelancer Class
> 
> I don't know if it's a remnant.
> 
> You may be doing property initialization and need to nail down scope:
> 
> class Student {
> 
> private var name:String
> 
> function Student( name:String ) {
>this.name = name;
> }
> }
> 
> -Scott
> 
> On 11/7/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:
> >
> > > I know I don't have to.
> > > But I think the code is more clear that way.
> >
> > Classes will not compile if you try to access variables that are not
> > declared in the class.  So by accessing a variable, it is inherently
> > referring to "this" because it absolutely must be, thus that
particular
> > use of "this" is redundant and a remnant of the days of AS1 classes
> > (prototype) and maintaining scope within them.
> >
> > That's not to say "this" doesn't have its place, but since its place
is
> > more refined now, I find it's more important to reserve its use for
> > those times so it stands out that much more.  However, everyone has
> > their own style and if using "this" gives you warm fuzzies, then who
am
> > I or anyone to take that away from you?  :)
> > ___
> > 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
> >
> 
> 
> 
> --
> 
> : : ) Scott
> ___
> 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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Steven Sacks | BLITZ
> I don't know if it's a remnant.
> 
> You may be doing property initialization and need to nail down scope:
> 
> class Student {
> 
> private var name:String
> 
> function Student( name:String ) {
>this.name = name;
> }
> }

That's just bad coding.  Don't use class variable names as argument
names.  It's not like you don't have a choice about it.  ;)
___
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


Re: [Flashcoders] Freelancer Class

2006-11-07 Thread slangeberg

I don't know if it's a remnant.

You may be doing property initialization and need to nail down scope:

class Student {

private var name:String

function Student( name:String ) {
  this.name = name;
}
}

-Scott

On 11/7/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:


> I know I don't have to.
> But I think the code is more clear that way.

Classes will not compile if you try to access variables that are not
declared in the class.  So by accessing a variable, it is inherently
referring to "this" because it absolutely must be, thus that particular
use of "this" is redundant and a remnant of the days of AS1 classes
(prototype) and maintaining scope within them.

That's not to say "this" doesn't have its place, but since its place is
more refined now, I find it's more important to reserve its use for
those times so it stands out that much more.  However, everyone has
their own style and if using "this" gives you warm fuzzies, then who am
I or anyone to take that away from you?  :)
___
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





--

: : ) Scott
___
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


RE: [Flashcoders] Freelancer Class

2006-11-07 Thread Steven Sacks | BLITZ
> I know I don't have to.
> But I think the code is more clear that way.

Classes will not compile if you try to access variables that are not
declared in the class.  So by accessing a variable, it is inherently
referring to "this" because it absolutely must be, thus that particular
use of "this" is redundant and a remnant of the days of AS1 classes
(prototype) and maintaining scope within them.  

That's not to say "this" doesn't have its place, but since its place is
more refined now, I find it's more important to reserve its use for
those times so it stands out that much more.  However, everyone has
their own style and if using "this" gives you warm fuzzies, then who am
I or anyone to take that away from you?  :)
___
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


Re: [Flashcoders] Freelancer Class

2006-11-07 Thread JulianG

I know I don't have to.
But I think the code is more clear that way.

Thanks,
JulianG

Rich Rodecker wrote:

you know you dont have to reference 'this' inside the class, right?  :D




___
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


RE: [Flashcoders] Freelancer Class

2006-11-06 Thread Steven Sacks | BLITZ
Project 3:16 - For Client so loved the work, that he told his one and
only Developer, that whosoever listens to him shall not finish, but have
eternal changes.
___
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


RE: [Flashcoders] Freelancer Class

2006-11-06 Thread Steven Sacks | BLITZ
Now you've got it!
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Rich Rodecker
> Sent: Monday, November 06, 2006 4:28 PM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] Freelancer Class
> 
> you know you dont have to reference 'this' inside the class, 
> right?  :D
> 
> 
> 
> 
> On 11/6/06, JulianG <[EMAIL PROTECTED]> wrote:
> >
> > // ActionScript 2.0
> >
> > class Freelancer extends Person {
> >
> > var available_time:Number; // hours per day
> >
> > // Constructor
> > function Freelancer( hs:Number ){
> > this.available_time = hs;
> > }
> >
> > function onIdle(){
> > if( this.available_time > 2 ){
> > this.workWithPixeltoys();
> > }
> > }
> >
> > function workWithPixeltoys(){
> > getURL("mailto:[EMAIL PROTECTED]");
> > }
> >
> > }
___
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


Re: [Flashcoders] Freelancer Class

2006-11-06 Thread Rich Rodecker

you know you dont have to reference 'this' inside the class, right?  :D




On 11/6/06, JulianG <[EMAIL PROTECTED]> wrote:


// ActionScript 2.0

class Freelancer extends Person {

var available_time:Number; // hours per day

// Constructor
function Freelancer( hs:Number ){
this.available_time = hs;
}

function onIdle(){
if( this.available_time > 2 ){
this.workWithPixeltoys();
}
}

function workWithPixeltoys(){
getURL("mailto:[EMAIL PROTECTED]");
}

}
___
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