ppk on JavaScript, 1/e

Author: Peter-Paul Koch
This Year Stack Overflow 2
This Month Stack Overflow 1


by anonymous   2017-08-20

As an example of an open source project you could look into I would recommend to check the dojo sources. It's easier to grasp the advanced concepts there than e.g. in JQuery since there is a much wider code base for many different aspects. There is a lot to go through in the dojox packages. The code is also nicely documented, and recently they added nice online documentation, too, something that was missing for a long time. I learned a lot by peeking into dojo's internals, so I can only recommend it.

You should pay attention to their way of coding object-orientedly and how it differs from what plain JS offers you.

In addition to great code you can learn the concepts of code minification there, which is a big deal for the dojo project. There's also material on unit testing with Javascript code, something that is often overlooked but as important as back-end unit tests imo.

By reading "Javascript - The definitive guide" you now know a good bit about the language itself and its usage for browser-based applications. But with the recent popularity gain of Javascript it has also found its application on the server side. E.g. node.js is a very interesting project you could look into.

The concept of "Closures" is something you could look up, then find examples in existing code and finally use them in your own.

"Ajax" is another buzzword and concept you should be familiar with, it lets you do all the nice things in your browser that some years ago were only possible in desktop applications.

Modern web applications make heavy use of Javascript, but since standard Javascript and its prototypical inheritance are a bit clumsy to use, frameworks were written that simplify common tasks. You should familiarize with one or more of them to get an understanding of what they simplify compared to plain Javascript - this way you will automatically learn the drawbacks and shortcomings of pure Javascript. A good example is the with keyword. It's there, but nobody uses it. If your time just allows you to delve into one of these frameworks then my recommendation would be jQuery - it's the most widely used Javascript framework out there.

Some Frameworks

  • jQuery
  • MooTools
  • Prototype
  • script.aculo.us
  • YUI 3
  • dojo
  • Ext.js

Read blogs and technical articles on the web, skim through Javascript questions here at Stackoverflow to keep up to date and learn about interesting corner cases.

Some book recommendations