View Full Version : Changes to ECMA script spec....
beetle
11-16-2002, 06:50 PM
What do you guys/gals think of this? I pretty much agree with him on most of this stuff
http://www.crockford.com/javascript/recommend.html
I don't agree with his preference for allowing reserved words to be variable names. They are reserved for a reason. This alone seems to eliminate half of his complaints.
One of his complaints is slightly unfounded:
function(){alert('hi')}() is does not work (like he says), but:
(function(){alert('hi')})()
Works fine. I don't see any reason to complain about this.
As for his readonly request, Mozilla has the const keyword:
const myConst = 7;
As for his apply() request:
http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/function.html#1194017
Added in JS 1.3.
I understand this is about ECMAScript, but Netscape has already implemented a lot of that stuff, which means a good chance ECMA will follow.
Besides, as soon as Javascript 2.0 comes out, I know I am going to avoid JS1 at all costs.
joh6nn
11-16-2002, 07:32 PM
he introduces a lot of interesting ideas, but he also introduces a lot of things that i don't necessarily agree with. i think that his views on constructors are either in need of some further explanation, or wrong. and he creates a whole new host of "Safety Operators" which i think could be better implemented as an extension of the typeof operator. but in the end, unless he bothers to make his views known to ecma, he's just another guy with an opinion.
<edit> as an afterthought, from what i've seen of JS2, we won't need to worry about any of this soon, because shortly, the language will have gone all to hell. </edit>
beetle
11-16-2002, 08:54 PM
Originally posted by joh6nn
<edit> as an afterthought, from what i've seen of JS2, we won't need to worry about any of this soon, because shortly, the language will have gone all to hell. </edit> Care to elaborate on that?
jkd, do you know when 2.0 will be out?
mordred
11-16-2002, 08:59 PM
I particularly liked the proposed isAlien operator... you can never be sure that your code has been under extraterrestrial influence.. :D
Originally posted by beetle
jkd, do you know when 2.0 will be out?
As far as I know, there is work underway (or at least planning) for a Javascript 2.0 Rhino interpretter. I don't know where this leaves the SpiderMonkey (C-based implementation that would be used in Mozilla probably) though.
And ECMA 4 isn't finalized yet, so it may be a while.
joh6nn
11-16-2002, 10:05 PM
beetle, in my opinion, JS2/Ecma4 (http://www.mozilla.org/js/language/es4/introduction/motivation.html) is an attempt to turn JavaScript into another Java or C, which i don't need. it seems to be a clear example of second system effect: i have a nice little scripting language, and now, they want to throw in a lot of bells and whistles, that i don't need.
don't get me wrong; i'm not saying there's no room for improvement, and i'm also not saying that none of the proposed changes are good. i just don't like the vast majority of them.
<edit> apologies to mordred </edit>
mordred
11-16-2002, 10:27 PM
@joh6nn: Who is the 'we' in your post?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.