Re: Has square bracket syntax always been supported ?
From: Randy Webb (HikksNotAtHome_at_aol.com)
Date: 08/24/04
- Next message: Mark Jerzykowski: "Re: Redirecting Iframe"
- Previous message: Agoston Bejo: "Re: Redirecting Iframe"
- In reply to: Saint Jude: "Has square bracket syntax always been supported ?"
- Next in thread: Saint Jude: "Re: Has square bracket syntax always been supported ?"
- Reply: Saint Jude: "Re: Has square bracket syntax always been supported ?"
- Reply: J. J. Cale: "Re: Has square bracket syntax always been supported ?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Aug 2004 08:50:42 -0400
Saint Jude wrote:
> Just a quickie.
>
> I wondered whether Javascript has always supported square bracket syntax for
> object properties.
> (some things lead me to believe it must have).
Yes.
> This is just a matter of interest.
> I'm trying to figure out the reason for the early (and still lingering)
> proliferation of eval("objectName.propertyName=" +valueString) statements
> in commonly available scripts.
Lack of better sense.
> I'm thinking
>
> 1. [] wasn't available, or
It was available.
> 2. These scripts were created by experienced programmers
> (exposed to Bash etc, perhaps)
> recently having learned Javascript, and unaware of its flexibility.
That is highly doubtful. Most people learning script learn it by
practicing, viewing other scripts, and reading books. All 3 sources,
unfortunately, use eval when its not needed.
eval is also propagated by the non-informed that write articles about
Javascript and think its "neat" to have a single way to do a lot of things.
About a year ago (I don't remember the exact time frame), I got an email
from a writer for one of the online computing magazines that wanted to
do an article on how great eval was <shudder>. He had searched the
archives and found a post of mine where I was trying to come up with a
non-eval way to convert a fraction to a decimal, other than splitting it
on the / and dividing.
Long URL:
<URL:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=20030818000514.00545.00000076%40mb-m02.aol.com&rnum=1&prev=/groups%3Fq%3Dhikksnotathome%2520eval%26hl%3Den%26lr%3D%26ie%3DUTF-8%26sa%3DN%26tab%3Dwg
>
Short URL:
http://tinyurl.com/6ny5l
What the "writer" did was searched the archives, ignored all the posts
against eval, and wanted to use some of the test pages I made comparing
eval to other methods, as an argument *for* eval. I wrote back
explaining that all of my test pages were free for use, but that I did
*not* want my name mentioned as supporting eval in those contexts. I
also asked for a URL to the article when it was published, but have not
recieved one to date.
And the result, inevitably, will be that some new scripter will read
that article, see how "neat" eval is, and then over use it and keep the
cycle going.
-- Randy comp.lang.javascript FAQ - http://jibbering.com/faq
- Next message: Mark Jerzykowski: "Re: Redirecting Iframe"
- Previous message: Agoston Bejo: "Re: Redirecting Iframe"
- In reply to: Saint Jude: "Has square bracket syntax always been supported ?"
- Next in thread: Saint Jude: "Re: Has square bracket syntax always been supported ?"
- Reply: Saint Jude: "Re: Has square bracket syntax always been supported ?"
- Reply: J. J. Cale: "Re: Has square bracket syntax always been supported ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|