Javascript modular programming of difficulty

Then on a " Javascript modular programming of Why " Speaking, Javascript after the heavy burden of the program also complicated. In a lot of modular programming language situation, Javascript can not stand idly by, ah, after all, this is a road through the test of practice. C ++ has a namespace , the Java has a bag, but Javascript What's it?

 

It has been all Javascript modular programming related articles, explains the Javascript of spring, on the other hand speaks Javascript modular programming is not so easy, do not believe you look at the C ++ and Java and other programming languages Modular the article will know. Do not namespace and package these mechanisms really so difficult? If merely the absence of these, really not that difficult.

 

I believe many people are learning to program from the C language beginning, but the actual work, only a few people use C language, more is to use C ++ , the Java language and other object-oriented. Individuals do not do in-depth analysis of the language, but object-oriented seemingly easier to solve complex problems with real work. I believe we almost feel that way. In object-oriented tasted the sweetness, you will love it. Unfortunately Javascript language with C language, in the language level, there is no real class, or else it will not appear prototype.js such a library foundation.

 

No real class What does it mean? The most direct language that can not be controlled at the level of what is private and what is public. For all external modules, for both the public. For this reason you will see a lot of Javascript code, there are many with "_" A variable name, which means what does that mean? This is a naming convention required by the private variable name preceded by "_" prefix, such variables can not be accessed outside the module. Although this restriction is not very tricky, but it can only be the case. No visibility restrictions, independent of the module will encounter great challenges. And to deal with these problems, it is not so simple.

 

Even true class does not exist, not to mention the other aspects. Furthermore, the modular programming difficulties due mainly rooted in Javascript abstract language level is too low, this will certainly lead to duplication of utilization is not high. For modular programming, this nature is not a good thing. Although faced with various difficulties, but it is difficult to live human IQ ah, always some way. C language is not the same to play the object-oriented operating system to play a thing! To C Interested language in this area go to Google , I only said that for the time being Javascript , how to play it out of the object, a modular play it?

 

Information on how funeral, see next decomposition!

Reproduced in: https: //www.cnblogs.com/worgeling/p/3606252.html

Guess you like

Origin blog.csdn.net/weixin_33825683/article/details/93910260