Web DevCenter
oreilly.comSafari Books Online.Conferences.
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA

Sponsored Developer Resources

Web Columns
Adobe GoLive
Essential JavaScript

Web Topics
All Articles
Scripting Languages

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed

Learning Lab

JavaScript: Why You Don't Know More About It

by Steve Champeon

In the previous article in this series, JavaScript: How Did We Get Here?, I talked about the genesis and early history of JavaScript, with an eye toward both its weaknesses and strengths.

In the end, I pointed out that no matter how you feel about JavaScript, it looks like it's here to stay. And in my opinion, that's not a bad thing at all. But for those of you who may have long ago written off JavaScript as a toy, perhaps it will take a bit more convincing. So, let's dig in and find out why you might have done so, and what can be done to overcome your misbegotten prejudices.

Why don't you know more about JavaScript?

As with playing the guitar, JavaScript is very easy to pick up and begin noodling around with, but difficult to master. Good technique can go a long way, but creativity and inventiveness (and willingness to take chances) can make the difference between code that barely runs now, and code that will continue to perform in the future.

JavaScript fundamentals are easy (and for the most part, if you're a C, Perl, or Java programmer, you already possess them), but as with any language, you can't let yourself be limited by a lack of imagination or unduly curtail your projects because something "isn't natively supported."

Let me jump back to the music metaphor for a minute. If you already know how to play the piano, then you can understand the guitar quickly. But understanding is one thing -- playing well is another. To play well, you still need to learn how to strum, flatpick, and adapt the chords you know from the keyboard to the fretboard.

Like the language of music, JavaScript is very flexible. The Document Object Models (DOM) that make it so powerful in conjunction with a browser often provides multiple methods to accomplish a given task. Those who can coax JavaScript to sing often use unique and innovative approaches to solving problems. In many situations, coders use techniques developed during the "browser wars" to guarantee cross-browser compatibility. But in most every case, the programmer is using a combination of the core language with various DOMs implemented by the different browsers.

Comment on this articleHow did you learn JavaScript? What tips do you have for others just testing the water?
Post your comments

As with C, Java, and Perl, JavaScript has a few fundamental language features (which, in fact, often derive from the languages mentioned) and a wide set of additional library functions. Some of these are built into the language, and some made available by the environment in which the scripts are executed.

As a result, the "language" taken as a whole is fairly large, and requires a great deal of effort to learn in its entirety. Few programmers are familiar with the entire range of possibilities inherent in the language, and it's common for scripts written by one programmer to rely on an entirely different set of features than those written by another.

This can make it difficult to learn JavaScript simply by looking at the source. In addition, the ability to include external JavaScripts can present an obstacle to those unaware of the mechanisms by which these external scripts may be viewed, for example, the "view-source:" pseudo-protocol in Netscape Navigator 4 or good old lynx -source http://example.com/some.js.

Pages: 1, 2, 3

Next Pagearrow