A programming language that is permanently mastered?

Source: Internet
Author: User

java Basic Tutorial )
static language vs Dynamic language


650) this.width=650; "src=" http://183.61.143.148/group1/M00/02/68/tz2PlFRLXRDQczQMAABA7h-Oa8M527.jpg "height=" 305 "Width=" 451 "/>

but JavaScript is different, and the type of the variable can be changed while the JavaScript program is running. In fact, when declaring a variable, you do not need to specify the type of the variable, when you use a variable, you can assign a whole number to the variable, and then overwrite the integer with a string, which is allowed in the dynamic type's language.
Although dynamic languages have only recently been great, the concept has actually been raised 50 years ago.
Functional Language
with the development of dynamic language, people's interest in functional language is becoming more and more great. In a functional language, the function itself can be stored in a variable, and the function stored in the variable can be passed as a parameter to another function. Most languages now support functional programming to some extent. For example, C++,c++ allows programmers to pass pointers to functions. Some languages, such as JavaScript, make it easier to pass functions. So, it is generally thought that C + + is not a real functional language, but that JavaScript is a functional language, and Haskell is generally considered a great example of functional language.
garbage collection Mechanism
Theoretically, you don't have any bugs if you write the code correctly. It sounds wonderful. But in fact, when you work with many other programmers to complete a large project, there is a bug that often occurs, which is the memory leak. You define a variable, and when you're done with the variable, you don't reclaim that memory in time, we say a memory leak has occurred. If a memory leak occurs and is not discovered in time, the program becomes larger as the program runs, until it consumes all of the system's memory, and then the system crashes.
you might say that every time you use a variable to free up memory, the memory leak doesn't happen. The idea is good, but the reality may be more complicated than that. For example, you apply for a linked list to store the data, the list is passed to another function, the function is written by someone else, in the other people write this function, the link list is copied, but you do not know, you say should delete this list or continue to keep? Based on this situation, programmers think of a workaround: to hand over the work of memory recycling to the system. When you no longer use a variable, the system scans the memory to find the memory that is no longer in use, and then proactively recycles it, which is called the garbage collection mechanism. For the newly developed language, this is a very important feature. The idea behind garbage collection is to make programming easier, allowing programmers to focus on creating great software.
It is necessary to note that there are several different garbage collection mechanisms: one is that the system periodically scans the memory and discovers those that are no longer in use, and the other is that the system keeps a tab for each variable and deletes it immediately once the variable is found to be no longer in use. Technically, the latter is not a garbage collection mechanism, but a "reference count", but the effect is consistent.
Virtual Machines

650) this.width=650; "src=" http://183.61.143.148/group1/M00/02/68/tz2PlFRLXSCi1bpcAAB7cWFlus4836.jpg "/>

When Java was born in the mid 1990s, people were concerned that it was not directly compiling the code into assembly language. In contrast to C + +, Java compiles a program into an intermediate code called bytecode when it is compiled. At run time, the system calls the virtual machine to execute the bytecode, and sometimes even just compiles the bytecode into the assembly code. When this compilation was just coming out, programmers complained that it was slow and of course it was no longer a problem. Many languages run on virtual machines, such as Java, C #, and so on. Now this type of language has developed rapidly in speed.
more Programming Language Tutorials please log in to E Mentor network.



This article is from the "Add Language" blog, please make sure to keep this source http://yuguotianqing.blog.51cto.com/9292883/1568206

A programming language that is permanently mastered?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.