As Douglas Crockford likes to say, JavaScript is the world's most misunderstood programming language. Although many people do not know this, there is a proper way to code in JavaScript. I have no doubt that if you let Java developers start coding before you understand how to write good JavaScript, you will run into serious problems.
The first thing to do is to make sure everyone reads the wonderful Mozilla article, a re-introduction to JavaScript ( https://developer.mozilla.org/en/a_re-introduction_to_javascript ). One of the biggest problems with JavaScript is that there are many ways to accomplish most common tasks, and this article should contain people on one page. Another important reference is the work of Douglas Crockford, including JavaScript: "Good Details."
Another thing that many Java / C ++ programmers get is that JavaScript using a function region does NOT block the region. This can cause some very complex problems. There's a wonderful article about this issue in List Apart called Binding in JavaScript.
To summarize the main issues discussed in the above resources, the most important differences to study are
- how to write object-oriented code using prototypal inheritance (class-based inheritance)
- how to use shutters and lambdas
- how to use the power of dynamic objects
- how to write code with advanced features
Zach b
source share