JavaScript, or Mocha, or LiveScript, or JScript, or ECMAScript, is one of the most popular programming languages in the world. Virtually every personal computer in the world has at least one JavaScript interpreter installed and actively used. The popularity of JavaScript is entirely due to its status in the field of WWW scripting languages.
Despite its popularity, few people know that JavaScript is a great dynamic object-oriented general-purpose programming language. This can actually become a secret! Why is this language so misunderstood?
Name
Java- The prefix can easily make people think of Java and think it is a subset of Java or a simplified version of Java. It seems that the name was originally chosen for it with ulterior motives, to deliberately confuse concepts and create "misunderstandings". JavaScript is not interpreted Java. Java is interpreted Java. JavaScript is another language.
The syntax of JavaScript is similar to Java, just like the syntax of Java is very similar to C. But it's not a subset of Java, just like Java is not a subset of C. It's better than Java in the areas that Java (Oak) was originally intended to go into.
JavaScript is not a product of Sun Microsystems, Sun is the home of Java. JavaScript was developed at Netscape. It was originally called LiveScript, well... that's still a good name.
-Script suffix makes people think that it is not a real programming language, and there is still a considerable gap between it and a "programming language". But this is only a matter of application domain. Compared with C, JavaScript sacrifices performance in exchange for rich expressiveness and flexible form.
Lisp in C skin
JavaScript’s C-like syntax, including the form of braces and statements, makes it look like an ordinary process-oriented programming language. This is a misunderstanding, because JavaScript has more in common with functional languages, such as Lisp or Scheme, than with C or Java. It uses arrays instead of lists, and objects instead of property lists. The function comes first, it has closure (how to translate closure??), and you can also use lambda expressions.
Type Conversion
JavaScript was originally designed to run in Netscape Navigator, and its success in Navigator led it to become standard equipment in virtually all web browsers. This creates "type conversion". JavaScript is the George Reeves (Superman) of programming languages and is a competent choice for a large number of non-web programs.
Moving target
The first few versions of JavaScript were very weak, with no exception handling, no internal functions and no inheritance. Today, it has become a fully object-oriented programming language. But many ideas in the language are based on its immature form.
The ECMA committee, the stewards of the language, is expanding it and deliberately exacerbating its biggest problem: too many versions. This is a source of confusion.
Design errors
No programming language is perfect. JavaScript also has its design errors, such as the overloaded + sign that means both "addition" and "connection" depending on the type, and the error-prone with statement that should be avoided. Its reserved word policy is too strict. The insertion of a semicolon is a huge mistake, for example when used as the symbol for a literal regular expression. These missteps have led directly to errors in programming and have called into question the overall design of the language. Fortunately, many of these problems can be mitigated with a good lint program.
The overall design of this language is quite obvious. The strange thing is that the ECMAScript committee has not shown much interest in fixing existing problems, perhaps they are more interested in creating new ones.
Poor Implementation
Some early implementations of JavaScript had many bugs, which in turn had a very bad impact on the language itself. What's even worse is that these buggy implementations are embedded in buggy web browsers.
Bad books
Almost all JavaScript books are pretty terrible. They contain errors, contain bad examples, and encourage bad practice. Some important features of the JavaScript language are either not explained clearly or not mentioned at all. I have read many JavaScript books, but I can only recommend one: JavaScript: The Definitive Guide (4th Edition) by David Flanagan. (Note to authors: If you write a good book, please send me a copy and I will proofread it for you.)
Standards of “quasi-standards”
The quality of the official language specifications published by ECMA is extremely poor. Not only difficult to read but extremely difficult to understand. It has contributed a lot to the "bad books" whose authors were unable to gain a deeper understanding of the language through this standard document. ECMA and TC39 should be very embarrassed about this.
Amateurs
Most people who use JavaScript are not programmers. They lack the training and training to write good programs. JavaScript is very expressive and they can do useful things with it anyway. This has given JavaScript a reputation as being more for amateurs than professional programmers. This is obviously a mistake.
Object-oriented
Is JavaScript object-oriented? It has objects, and its objects can contain data and methods for operating on the data. Objects can also contain other objects. It does not have classes, but it has constructors to do class things, including declaring class variables and methods. It does not have class-oriented inheritance, but it has prototype-oriented inheritance.
The two main methods of building object systems are inheritance (is-a) and aggregation (has-a). JavaScript has both, but its dynamic nature allows for better implementations than aggregation.
Some arguments that JavaScript is not really object-oriented are based on the fact that it does not provide information hiding. In other words, a JavaScript object has no private variables or methods: all its members are public.
But the fact is that JavaScript objects can have private variables and private methods (click here to see how to do this). Of course, the reason so few people know this is because JavaScript is the most misunderstood language in the world.
Another argument that JavaScript is not really object-oriented is that it does not provide inheritance. But the fact is that JavaScript not only supports classic inheritance, but also supports other code reuse patterns.
Translation: Yuan Xiaohui Original link: http://www.crockford.com/javascript/javascript.html

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr

Node.js excels at efficient I/O, largely thanks to streams. Streams process data incrementally, avoiding memory overload—ideal for large files, network tasks, and real-time applications. Combining streams with TypeScript's type safety creates a powe

The differences in performance and efficiency between Python and JavaScript are mainly reflected in: 1) As an interpreted language, Python runs slowly but has high development efficiency and is suitable for rapid prototype development; 2) JavaScript is limited to single thread in the browser, but multi-threading and asynchronous I/O can be used to improve performance in Node.js, and both have advantages in actual projects.

JavaScript originated in 1995 and was created by Brandon Ike, and realized the language into C. 1.C language provides high performance and system-level programming capabilities for JavaScript. 2. JavaScript's memory management and performance optimization rely on C language. 3. The cross-platform feature of C language helps JavaScript run efficiently on different operating systems.

JavaScript runs in browsers and Node.js environments and relies on the JavaScript engine to parse and execute code. 1) Generate abstract syntax tree (AST) in the parsing stage; 2) convert AST into bytecode or machine code in the compilation stage; 3) execute the compiled code in the execution stage.

The future trends of Python and JavaScript include: 1. Python will consolidate its position in the fields of scientific computing and AI, 2. JavaScript will promote the development of web technology, 3. Cross-platform development will become a hot topic, and 4. Performance optimization will be the focus. Both will continue to expand application scenarios in their respective fields and make more breakthroughs in performance.

Both Python and JavaScript's choices in development environments are important. 1) Python's development environment includes PyCharm, JupyterNotebook and Anaconda, which are suitable for data science and rapid prototyping. 2) The development environment of JavaScript includes Node.js, VSCode and Webpack, which are suitable for front-end and back-end development. Choosing the right tools according to project needs can improve development efficiency and project success rate.

Yes, the engine core of JavaScript is written in C. 1) The C language provides efficient performance and underlying control, which is suitable for the development of JavaScript engine. 2) Taking the V8 engine as an example, its core is written in C, combining the efficiency and object-oriented characteristics of C. 3) The working principle of the JavaScript engine includes parsing, compiling and execution, and the C language plays a key role in these processes.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment
