News for hackers. Stuff that matters.

What's the K&R for JavaScript?

Yes, I know JS The Good Parts but there's so much noise out there about best practice, memory mgmnt etc. What's the bible right now? If K&R doesn't mean anything to you - you're young and haven't programmed in C.
( 11 comments | 8 points | on HN )
Re:What's the K&R for JavaScript? by anonfunction on Wednesday October 22, 2014 @04:23AM (#8491865)
I'm young and haven't programmed in C. This is a great resource though: http://eloquentjavascript.net/
Re:What's the K&R for JavaScript? by eat on Wednesday October 22, 2014 @11:43AM (#8493214)
On an equally irrelevant note, I'm young and have programmed in C.
Re:What's the K&R for JavaScript? by anonfunction on Thursday October 23, 2014 @01:26AM (#8496809)
Did 'K&R' mean anything to you?
Re:What's the K&R for JavaScript? by chug2k on Wednesday October 22, 2014 @04:19AM (#8491858)
Came here to paste a link to the good parts. I see you've already got that.

Honestly, the most useful reading for me has been the annotated source to Backbone and Underscore. Amazing that he wrote it, even more amazing that he annotated it. Guy's a genius.

http://backbonejs.org/docs/backbone.html http://underscorejs.org/docs/underscore.html

Re:What's the K&R for JavaScript? by MalcolmDiggs on Wednesday October 22, 2014 @05:54AM (#8492056)
There's nothing as canonical for js as K&R was for C. My guess is that it's just changing a little too fast.

If you want raw unassailable reference docs (to learn js from the ground floor in comprehensive detail) you can't go wrong reading the standards:

http://www.ecma-international.org/publications/standards/Ecm...

http://es5.github.io/

The rest you kinda gotta cull from various resources. learn.jquery.com is nice and Mozilla kicks ass, as usual: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Information about ES6 generators and other stuff coming down the pipe seems to be scattered all over the place. Best resource I've found seems to be this one:

http://people.mozilla.org/~jorendorff/es6-draft.html

Though promisejs.org and promisesaplus.com are worth browsing.

Re:What's the K&R for JavaScript? by vgallur on Wednesday October 22, 2014 @05:33AM (#8492016)
I'd say "Professional JavaScript for Web Developers", by Nicholas C. Zakas
Re:What's the K&R for JavaScript? by radmuzom on Wednesday October 22, 2014 @03:04PM (#8494461)
Professional JavaScript for Web Developers is more like the "C: A Reference Manual" (Harbison / Steele) rather than K&R.

To me, "The Principles of Object-Oriented JavaScript" by the same author is the equivalent of K&R. Just don't be misled by the title, it covers the functional aspects of JavaScript as good as any other book and does not push for object-oriented programming as the one true way at all.

Re:What's the K&R for JavaScript? by hkarthik on Wednesday October 22, 2014 @11:35AM (#8493164)
Totally agree. This is the book I usually recommend to people wanting to get serious about Javascript.
Re:What's the K&R for JavaScript? by brudgers on Wednesday October 22, 2014 @04:37PM (#8494962)
There isn't anything.

K&R is canonical because in 1978 books were the way programming language information was distributed. It was a different time. Hell, in 1979 Godel Escher Bach won the Pulitzer Prize for non-fiction. Can you imagine the general public reading something that challenging for fun these days?

On the flip side, most programming books are more informative than what is essentially a specification. The industry has come a long way.

Re:What's the K&R for JavaScript? by dragonwriter on Wednesday October 22, 2014 @04:42PM (#8494979)
> Hell, in 1979 Godel Escher Bach won the Pulitzer Prize for non-fiction. Can you imagine the general public reading something that challenging for fun these days?

The relationship between "Pulitzer Prize for non-fiction" and "general public reading [...] for fun" has always been pretty distant.

Re:What's the K&R for JavaScript? by TheFoozle on Thursday October 23, 2014 @10:22AM (#8498239)
Thanks all. Good responses. Though I have to say I'm a bit nostalgic for formality at times (and slightly disappointed). Hope that doesn't make me a snob. On the Godel, Escher, Bach, note - I just heard a great interview with Douglas Hofstadter on Radiolab - worth a listen.