This article is intended for anyone who uses JavaScript. Beginners to advanced javascript programmers will benefit from reading it. There is something here for everyone.
JavaScript is often learned quickly by those without a strong background in object oriented design. Obviously, learning a programming language in a short amount of time usually results in incomplete knowledge and experience. This article shares programming techniques for JavaScript. For this reason, new programmers will benefit greatly by learning how to design for both performance and clarity.
Experienced JavaScript programmers may pick up a few new techniques and ideas that they may not have seen.
Programmers who have experience with other object-oriented languages will benefit by learning performance techniques that are specific to JavaScript.
There is something here for everyone.
Due to its flexibility and ease, JavaScript has become quite popular. Pages that demand greater interactivity require more JavaScript.
JavaScript is possibly the slowest language ever. As we add progressively more JavaScript, we find that our pages slow down, making them less fun to use.
Performance tuning is about getting as much performance as possible out of our programs. It is about analyzing the code and making changes.
Certain performance-enhancing techniques (such as Duff's Device, not dicussed here) will make our code harder to read and maintain. Such techniques usually offer very little performance benefit. Techniques which make the code less clear and less explicit make the code more difficult to develop and maintain. The consequential effect is that this makes the code less tunable. This means that some other performance-enhancing technique will probably be overlooked. At worst, such techniques will introduce bugs that may or may not present themselves immediately.
Next in this tutorial: Designing for Code Clarity