views:

145

answers:

4

I'm looking for a decent book or online resource to help me learn about developing large Javascript applications.

There are lots of books that go over the fundamental and advanced features of JS, but I'm looking for something which covers application structure, coding practices etc.

Any ideas?

+1  A: 

The only book you will need: The Good Parts by Douglas Crockford

+1 for another good O'Reilly JS book. I don't have it, but I've heard good things!
David Titarenco
+1 this book changed my view on the language entirely. A must read.
ralfstx
-1 This book has nothing to do with "developing large Javascript applications".
edwin
IMO, If the OP needs to ask questions like he did (building 'large' applications in JS isn't exactly rocket science if you have a solid grasp on the language), it's most likely a good resource for him. So my +1 stands!
David Titarenco
I actually read that book yesterday. It is certainly a worthwhile read and gives good foundation information, but it doesn't really give much details on application structure. But it's not trying to do that.
Mr. Flibble
I used the conventions in that book and JSLint as the style guide for building my large application in JavaScript. Its nearly 4000 lines of code. The power of JavaScript is in use of closure for multi-tiered deduction and object literals for defined data reference, so that book is really all you need.
I agree with Rabe an excellent book that can change you mind about JS. I disagree with edwin when he says it in not about large apps. Well no not directly but of course you cannot build large applications with poor foundations. The good parts, well heeded and read intelligently will help to ensure good foundations. One of my main gains from the book was about JS being a Prototype based language and not a class based language and just that fact, absorbed and understood, will save a ton of grief in the future.
PurplePilot
+1  A: 

There are no good/bad/decent coding practices when it comes to JavaScript... and I'm not even kidding.

I have http://oreilly.com/catalog/9780596000486 which analogises JS constructs to their C++ or Java counterparts and I find it useful, especially when trying to figure out how an "application" should look like.

Arguably, however, is that JS is powerful (or maybe popular?) because of lambda functions and I suggest looking at websites like: http://www.hunlock.com/blogs/Functional_Javascript to understand the ramifications of lambda and how to use them intelligently.

In short, there's 99 ways of solving any problem in JS, and usually, none are the correct way :P

David Titarenco
A: 

Try this: Object-Oriented JavaScript: Create scalable, reusable high-quality JavaScript applications and libraries

xdevel2000
Have you read it? Judging by the title it looks perfect, but one Amazon reviewer wrote: "...but if you're looking to learn how "Create scalable, reusable high-quality javascript applications and libraries", it is nearly useless. There were a total of two chapters that I found useful to a non-novice. One covered inheritance options in incredible details (which is great), and the last chapter gives lip service to covering common OO patterns with javascript. That's about it. "Introduction to creating objects and simple OO patterns in Javascript" would have been".
Mr. Flibble
Like I said in my answer: there's no such book. There are no `standards` in JS. There is no "good" way of making large apps. You'll need a class loader.. that's as far as most people go. The way you structure it is up to you. You can do it a million ways and they are all valid. As long as it makes sense and as long as it's readable, you should be fine. Note that "traditional" oop-paradigms don't fully apply to JS because of it's lambda nature.
David Titarenco
+1  A: 

I haven't come across any such book that's specifically aimed at developing large applications with Javascript itself.

However, there is still hope. Checkout the frameworks that are specifically aimed at developing large scale applications in Javascript.

jQuery ;-)

Ok. Seriously, a new wave of frameworks have come about in the past few years. All of these are open-sourced, so you can get a good idea of how their applications are usually structured.

Though we can argue GWT doesn't belong in that list because you technically don't code in Javascript but the end result is the same - a Javascript web-application, and the organization principles certainly apply here as well.

With the new additions to HTML5, it's possible to write a fully desktop style application and thus the same principles that were used for creating large Flash, Java, .. applications can be used in the Javascript world. Checkout what HTML5 brings to the table to help in building large Javascript applications - http://apirocks.com/html5/html5.html#slide1

And a bunch of other articles and resources aimed at architectural organization of Javascript code, though almost all of these tend of favor MVC.

Anurag