News for hackers. Stuff that matters.
Re:Apple JavaScript Coding Guidelines by tlrobinson on Sunday October 31, 2010 @09:10PM (#1854956)
This is a really terrible guide. I just skimmed it and found several major errors:

1. It's pretty well accepted that constructors should be capitalized. This is a minor style problem compared to everything else.

2. The entire section on "freeing" objects is just wrong. Not going to bother explaining why.

3. This is wrong:

   MyChildObject.prototype = MyParentObject.prototype;
Your entire inheritance tree will share a prototype, and adding a property to one constructor's prototype will add it to all of them, even the parents. You need to do something like "MyChildObject.prototype = new MyParentObject;" or "MyChildObject.prototype = Object.create(MyParentObject.prototype);"

4. The copying section contains a for-in loop without a obj.hasOwnProperty(name) guard.

Re:Apple JavaScript Coding Guidelines by Tomek_ on Sunday October 31, 2010 @10:24PM (#1855129)
"This is a really terrible guide." would be just enough to sum up this guide. If you're JavaScript newbie just skip it all along and spend that saved time on reading anything from someone like Douglas Crockford.
Re:Apple JavaScript Coding Guidelines by natch on Sunday October 31, 2010 @11:17PM (#1855223)
It would be great if you would submit this feedback on the document using the link at the bottom. Based on personal experience, Apple fixes bad documentation when it is reported.
Re:Apple JavaScript Coding Guidelines by gaoshan on Monday November 01, 2010 @01:07PM (#1857186)
So if you are reading this and wondering "Then where can I get a decent style guide?" perhaps try this one instead: http://google-styleguide.googlecode.com/svn/trunk/javascript...