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.
Apple JavaScript Coding Guidelines [pdf]
11–20 of 29 posts
Or any other language that denotes comments with an octothorpe, but I opted for brevity.
Re: Apple JavaScript Coding Guidelines [pdf]
#12I 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)
Re: Apple JavaScript Coding Guidelines [pdf]
#13Man, what a piece of shit. Apple should pull this immediately.
Good that I saw this before reading the pdf. Can you point me to a better resource?
As seen elsewhere in the comments, Crockford's is very good:
Re: Apple JavaScript Coding Guidelines [pdf]
#14The example in this document of using the delete operator on a function is wrong.
Re: Apple JavaScript Coding Guidelines [pdf]
#15Two years old?
Re: Apple JavaScript Coding Guidelines [pdf]
#16I 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.
I'm pretty sure Ruby is bigger than Perl and sh put together now, at least in mindshare.
Re: Apple JavaScript Coding Guidelines [pdf]
#17Already discussed in http://news.ycombinator.com/item?id=1854783 with the same consensus, it's a terrible guide. Read Crockford, Stoyanov, Bolin instead.
Re: Apple JavaScript Coding Guidelines [pdf]
#18It’s shocking that this document refers to "classes". JavaScript doesn’t even have classes.
Re: Apple JavaScript Coding Guidelines [pdf]
#19It’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.
Re: Apple JavaScript Coding Guidelines [pdf]
#20Man, 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.