> Kevin, why do you allege "bad practice"?  What are you referring to for
that matter?

I 2nd bad practice. It's unreadable and less efficient. I would hate to read
code where ids were named myComponent1, myComponent2, etc... It would be so
much better to just reference readable names in an indexed Array.

# var myComponents:Array = [ idFirstName, idLastName, idEmail ];
#
# for (var i=0; i<myComponents.length-1; i++){
# var example:Object = this.myComponents[i];
# //do some more stuff
# }

Although, I can't think of any reason why you would want to loop through
components like that in the first place. Maybe .NET has different practices
though.

Regards,
~Aaron






On Mon, Mar 24, 2008 at 7:38 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote:

>    I have seen and used the term "bracket notation".  Don't know how
> common it is.
>
>
>
> Kevin, why do you allege "bad practice"?  What are you referring to for
> that matter?
>
>
>
> Tracy
>
>
>  ------------------------------
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Kevin Aebig
> *Sent:* Monday, March 24, 2008 9:47 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* RE: [flexcoders] What's this Called?
>
>
>
> That's called bad practice. The lookup method you're referring to is
> called an associative array or dictionary.
>
>
>
> !k
>
>
>  ------------------------------
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Nate Pearson
> *Sent:* Monday, March 24, 2008 6:18 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] What's this Called?
>
>
>
> When I do this["idOfsomethingImLookingfor"]
>
> I usually do this if I have to loop something.
>
> So:
>
> for (i=0; i<10; i++){
> var example:Object = this["myComponent" + i]
> //do some more stuff
> }
>
> I'm trying to do the same thing in .NET. I don't know what it's
> called though so I'm having a hard time googling it.
>
> Thanks,
>
> Nate
>
>  
>



-- 
Aaron Miller
Chief Technology Officer
Open Base Interactive, LLC.
[EMAIL PROTECTED]
http://www.openbaseinteractive.com

Reply via email to