Most people use JavaScript for advanced applications, whether it's a company colleague or an external programmer.
This article, which I accidentally saw today, shares the same feelings and has always felt that JavaScript is more or less biased. This article tells my mind.
. Poor JavaScript (from Practical JavaScript DOM Scripting and Ajax Projects)
Most people do not know much about advanced JavaScript applications, whether they are colleagues in the company or programmers outside the world. In the existing knowledge architecture, JavaScript is considered to be just a scripting language, its role is to make some icing on the cake for the page, such as form verification. The subconscious will not use the object-oriented idea to write JavaScript code, nor will it have a deep understanding of prototype, context, scope chains, closures, and other concepts. This leads to a traditional scripting habit:
- Write a lot of functions in html pages or js files
- Directly call the function where the function is needed
The above practices are process-oriented and seem quite natural, but there are actually many drawbacks. In team collaboration, code conflicts are added, and reusability and maintainability are low. This is an old coding habit that should be eliminated.
The most important thing to learn about JavaScript is to recognize that JavaScript is not a toy language. JavaScript is far more than adding dot form verification. We can look at GMail and Google Maps. If developers do not have enough respect for JavaScript, it is unlikely to write such a good Web application.
The JavaScript threshold is low, but the low threshold does not mean it is easy to master. To a certain extent, it is easy to get started with JavaScript and its great flexibility, making it difficult to master JavaScript (similar to Ruby, Ruby is also a language that is easy to get started ). In terms of pure language (without considering the framework class library), my personal experience is that it is more challenging to learn JavaScript than to learn Java. Most of us are used to traditional object-oriented expressions. To some extent, we may even think that classes, encapsulation, inheritance, and other concepts have to be like Java and C ++, it may have never been thought that class, extend, override, and other concepts can also be object-oriented. The object-oriented JavaScript has broken the shackles of this kind of thinking: The world is diverse, and all things go through Rome. To put it bluntly, an in-depth study of JavaScript is more of an ideological challenge. It is able to activate ideas, broaden your horizons, and even change your views on the world.
As mentioned above, it is not intended to exaggerate the role and difficulty of JavaScript. Everyone will emphasize more or less what they have learned, but here I hope that I can objectively pass on a point of view: No matter what language, it is not easy to be proficient; if you want to learn a language, you must respect it in your mind and learn it on the basis of respect. In addition to JavaScript, let's take two examples:
The first is the CMD script. Dir, cd, for, and tree are easy to use. Many people who want to master CMD scripts will spend some time studying hard, however, most of them will not even write a simple backup script. These people cannot master the CMD script because of their own demons. The subconscious thinks that CMD is easy and does not "respect" it, therefore, the actual action will not really focus on learning CMD.
The second is the HTML language. I often hear this: HTML is so easy that it takes a day or two to complete. I thought so myself. However, as the experience in using HTML grows, I gradually feel that HTML is the most difficult for front-end Web development. The 91 elements in the HTML4.01 specification are the same as the 2500 common characters in Chinese characters. After reading elementary school, we should know all the common words, but we should write an excellent article with Chinese characters, but it is not easy. This is also true for HTML. Most developers who claim that HTML is very easy tend to stay on tags such as recognizing the body, p, form, table, div, and ul. For dl, legend, sub, caption and other non-Uncommon labels are not even recognized. When the commonly used words are still incomplete, it is really arrogant to claim that HTML is very easy. (The difficulty of HTML lies in how to use tags to build well-structured and semantic-rich code. Just like writing a text, you cannot think that you can be confident in understanding a few words .)
In short, the language is easy and easy to use. You must respect and pay attention to a language in your mind before you can control it. Otherwise, it will always be out of the hall of professional programmers.
. JavaScript gained due respect (from Practical JavaScript DOM Scripting and Ajax Projects)
For JavaScript, we must first realize its power. At present, various browsers are scrambling to optimize and improve the performance of the JS engine, which shows the powerful vitality and bright future of JavaScript. Removing contempt for the scripting language from the demons and respecting JavaScript is no longer a problem for our programmers who are already engaged in front-end development. However, we still need to publicize and preach that there is still a long way to go to make backend developers aware of this.
On the one hand, the other is: "We need to pay attention to how JavaScript is used, or perhaps more attention to what JavaScript can do ." This is a point that Aaron Gustafson emphasizes in his article on progressive JavaScript enhancement. Being proficient in a language also means knowing where the language is not suitable for use. No language can be abused. You need to use different knives in different scenarios. Every good butcher has his own set of knives, not like Guan Yu.
This article is available at http://www.nowamagic.net/librarys/veda/detail/1219.