28 comments

[ 13.1 ms ] story [ 1043 ms ] thread
I find it strange that the "Global Scope Considerations" section uses Ruby-style inline comments (#) rather than actual JS inline comments (//).
I find it strange that you refer to comments starting with # as Ruby-style comments.
Or any other language that denotes comments with an octothorpe, but I opted for brevity.
I'm pretty sure Ruby is bigger than Perl and sh put together now, at least in mindshare.
python and PHP also support # for making comments. It could be argued that python has just as much if not more mindshare than ruby. :)
I agree. I think "Python-style comments" would be just as reasonable a term. My impression was that the comment I was responding to was objecting on historical grounds, since Ruby and Python borrowed that comment style from Perl, which in turn borrowed it from shell scripts.
(comment deleted)
For those who would prefer an HTML version: http://developer.apple.com/library/mac/#documentation/Script...
Or the actual PDF itself, which lacks the Scribd™ value-added feature of banner ads on every page:

http://developer.apple.com/library/mac/documentation/Scripti...

(comment deleted)
> Just as you used the new

> operator to create an object, you should delete objects when you are finished withthem, like this:

> delete myObjectVariable;

What a bunch of crap? Have these guys even looked at the specs?

And chapter on inheritance really makes me cry...

Man, what a piece of shit. Apple should pull this immediately.
I agree. Also they aren't using 1TBS for the code examples, and that will naturally lead to noob javascript programmers running into trouble when they inevitably type

  return  
  {
    hello:"world"
  }
using 1TBS will naturally lead the programmer to type the correct javascript syntax

  return {  
    hello:"world"
  }
1TBS is naturally a better fit for javascript programming.
I have a strong reason to suspect that this was written by an intern who was relatively new to the language. It seems to be written by someone in the C/C++/Java mindset (ie how they didn't list "function" as a primitive data type)
Function is not a separate data type in JavaScript, but they could probably list Object there (EcmaScript defines 6 types and 5 primitive values, I can't really find any definition of "primitive type")
It’s shocking that this document refers to "classes". JavaScript doesn’t even have classes.
Why is this comment deprecated? He's absolutely right, if a little late to the party. Shockingly bad document from Apple.