drop the 'this' unless its necessary to explain something..


On 08/04/2008, at 5:39 PM, Mike Anderson wrote:


Greetings All,

Whenever I study code generated by seasoned programmers (i.e. all the Adobe people supporting Flex on this list) as well as countless others on this list, I notice that some use "this" when referencing local variables contained within a Class.

The last thing I want to do here, is start a heated discussion regarding "best practices" for programming. My goal on a daily basis, is to better myself as a programmer, and I want to make sure that the code I create, conforms to certain standards.

Could some of you please offer your 2 Cents regarding the advantages/ disadvantages of using "this"? Just a quick example:

package
{
    public class myClass()
    {
        private var testVar:String;

        public function myClass( value:String )
        {
            this.testVar = value;
            // versus:
            testVar = value;
        }
    }
}

Thank you all so much in advance, for any help you can offer regarding this topic.

Mike




Reply via email to