One sentence I think is a famous saying for programmers: the future trend of programming is libraries, dynamic scripting languages, and virtual machines. I thought it was right when I heard this sentence, but it took a long time to understand it (especially the last half sentence) and it is still halfway through.
I have always liked a basic design concept of C ++, that is, some things should be done by language, but more things should be handed over to the library for implementation. This idea makes C ++ applicable to various fields. The language should give the programmer sufficient freedom, from the bottom to the top, from the machine level to the layer that is closest to reality. Then, in this language, we will write the database again, it is used in various proprietary fields. C ++ has become an industrial standard. The libraries written by C ++ can be used and bound by various languages. It is used to write various languages. Any comments that promote the decline of C ++ are narrow-minded. It does not see C ++ as a cornerstone of many things today. C ++ is an excellent solution for static languages.
C ++ is compatible with C and promotes its standardization. Now it seems that it is a bit smarter. Today, many libraries are still written in C. The vitality of C is the most important cornerstone of C ++'s success. In the course of understanding the numerous highlights of C ++, I thought that C had fallen, but later I was practicing and more on the source code (GCC and Linux kernel) in the reading of C, the value of C will never disappear. Seeing the implementation of OOP and even AOP in C, just as when I saw the compiler using scheme in SiC, I realized that the language is lighter and simpler, but it allows the most complete use of human intelligence, and to some extent understands why Linus says "C ++ to C is Lang cancer to Lang ". A lot of things in C ++ seem very syntactic sugar-coated now. However, one of its most valuable values lies in the fact that, in one language, we have learned Oo, polymorphism, and generic thinking, and at the same time provide a description of these thinking. C ++ is the best description language of the design pattern. I have seen many books describing the design pattern using a language that is inherently deficient in Java.
Yes, I hate Java. Although I have been paying attention to and learning its technologies, including EJB, struts, Hibernate and spring, in addition, the book J2EE development without EJB gives me a greater liking for the technology behind the language. In addition, I recently saw an article that pointed out that Java is not slow,, the core reasons why I hate this language cannot be shaken by all the undisciplined prejudices. I don't remember who said that Java was his first time learning a new language without any new surprises and new ideas. I want to add the last half sentence: "instead, I feel that I have lost a lot of things at once ". Java makes everything in Oo no longer beautiful and troublesome. This is the price we pay for the so-called simplification. C ++ is huge and profound. Anyone who is afraid of difficulties can live in the simple part of the language, and the writers can make full use of other aspects of the language. With a well-written smart pointer library and proper and moderate use of it, it is ridiculous to use a language to "Free programmers from the quarary of Memory Management. Programmers are not self-disciplined and library-related. Programmers love programming, that is, they like the feeling that everything can be done and everything can be controlled. Static languages cannot lose pointers or references, and programmers should not get bored with Const. Why do we need heap in addition to stack? When you leave the scope, the stack will strictly help you recycle things you have used, but you will not take things you have used. With the heap, you can take it away, and you can let it go when it should be recycled. Hosting means that you lose control of everything. You have to leave everything to the ground and wait for the robot to pick up your napkin. In addition, when using Java-written programs, the memory is often released and crashes. So why? Static language should not discard its memory management and restrain itself.
The key to the popularity of Java is that it binds the class libraries relatively uniformly. It uses virtual machines for cross-platform, and it integrates multithreading, it adopts advanced technologies and frameworks in the Web and embedded aspects. These constitute its vitality. It is impossible for someone to say that it will die. I don't see its vitality, but I have always preferred that these concepts and technologies are based on a less ugly language, especially those who cannot tolerate drinking java coffee, and are not so cool at C ++, and the programmers who call java the first love are very disgusted. I cannot believe that the people who invented Java will be really senior C ++ programmers who suffered from the hard work of C ++ in their early years. By the way, I quite understand why everyone will pile up these technologies on java. Java's simplicity (from the perspective of compilation implementation) and memory hosting are indispensable. Everything is a disaster caused by the timing and real historical processes.
After reading D & E, I admire stroustrup. I admire him for sticking to his own language design philosophy in front of the tastes of various programmers and keeping the language pure, so that the expansion of C ++ does not shape itself, this is not what anyone can do. Here are two examples I like most: the pure virtual function = 0 syntax, And the suffix ++ overload method (operator ++ (INT )). However, some may disagree with this. Let's talk about some of my favorite areas of C ++: Keep as few keywords as possible, make good use of operators, and reload operators (unfortunately not enough freedom, it would be nice to have a function with a custom operator), with function overloading with the same name, enumeration, well-designed structure and destructor (just as reassuring as a stack ), class definition and implementation separation, templates, and the corresponding generic programming, with the scope of typedef and traits technology, retain the powerful C pre-processing macros (to learn C ++, you must first learn not to use macros, and then learn to make good use of macros. Unfortunately, define is difficult to use each other), with pointers and references, and various Const, there is a namespace for strong type checks, but there is implicit type conversion, there are multiple inheritance that can be fully utilized, there is a well-designed virtual function polymorphism system and cute->, A lot of things are handed over to the database rather than bundled into the language, which allows us to have more choices. There are too many things in Java, and every of the above technologies is a good friend of programmers. The problem with C ++ is that the implementation of the compiler is not perfect.
It should be said that C ++ programmers who have not used too many libraries/class libraries (especially open-source libraries) are not c ++ programmers. A variety of general-purpose or proprietary-purpose libraries are very helpful for the growth of programmers. They will train programmers to build a programming environment and quickly get started with documents and examples, the ability to use hack to solve various bugs, portability, or dependencies and to customize libraries keeps programmers standing in the face of emerging new technologies. Since libraries are usually bound to various languages, libraries also allow programmers to quickly get rid of the language constraints. As long as there is a library, the programmer's capabilities are unrestricted. The rest is the Mythical man-month. I have been involved in various class libraries all the time, and their source code is like a volume. If there is enough time, I can sit down and take the essence of them as I think Xuan can.
Before C ++, I used logo, gwbasic, C, and VB. After C ++, there are few other languages that can surprise me, until I have a wide range of exposure to dynamic scripting languages. Bash was the first surprise about the script, but now it seems that it is too unscripted and not dynamic enough. Later I used or learned assembly (x86, a little PowerPC, now I am learning Mmix), make, latex, Matlab, actionscript, JavaScript, lex/YACC, CSS/XPath, XML/JSON/yaml, grapghiz, metapost, scheme, squiril, PHP, Python, Ruby, Lua, Erlang, and other languages should have seen various syntaxes for a while, some of the favorite languages have been used in multiple periods, and they have been chewed and re-discovered.
Recently, I made a website (DHTML/CSS + lamp + Ajax) and read prototype source code, so that I had a new discovery of JavaScript, during the same period, I was pleasantly surprised to learn Ruby. I recommended these two languages to everyone. These two dynamic languages are best suited to breaking the static thinking of C ++ programmers. php is also good, in addition to using it as the backend of the website, it is also good to use it for zero activity. In contrast, I still don't like python so much that I need to discover it again in the future. Javascript processes the internal variables of a function (hanging as an attribute of the function) and treats the function as a common variable so that its function can be used as a Lamda function, it can also be used as (a continuously Scalable) class, or even as a package, with a great design. Javascript even develops JSON as a data sharing format, which is much better than XML. I believe it will play a very important role in distributed applications. JavaScript and Java are basically two completely different languages and completely different thinking paradigms. I used to have too many misunderstandings about them. Because Javascript is similar to C, it is not difficult to master it, But ruby requires you to get used to another way of thinking about problems and writing statements. The iterator in ruby is one of its biggest highlights. It uses the returned values of the previous statement and the {} block in a very enlightening way. Another thought that needs to be adapted is that there is no strong type check, only duck-typing, that is, if we only need one object to be called like a duck, as long as this object can be called like a duck, we accept that it is a duck, no matter what it actually is. I have never adapted to the non-type nature of dynamic language. I was fully aware of its power in this application. Ruby is a wonderful place, so we won't mention it here.
A few years ago, some books suggested that after learning C/C ++, Java is a very suitable second language. It is only now that we know that the big mistake is wrong. The second language of a programmer should be a scripting language, which is used to quickly complete some idle tasks and make the programmer's thinking flexible. The design philosophy of the scripting language must not be the same as that of the static language, so that the language is more pure and the thing is done by the library. Many common functions need to be embedded in the script language, not only through the core library to provide these functions, but also to support more convenient calls at the language level. Regular Expressions are at least one of them, and database access and multithreading are also very important (and look at Ruby's mutex. Synchronize {}).
Another advantage of Dynamic Language is eval (). We can dynamically generate and execute script strings using scripts, which is one of the reasons bash surprised me at the beginning. Naturally, you can access the created variables, functions, classes, and symbol just like accessing an associated array. It is also the greatest freedom for programmers to use dynamic languages. These two functions enable us to use a language constructed using a language, while the latter enables us to enter the language Meta layer. The former is built, and the latter is dug up. In this way, we can go beyond the single plane provided by the language and have a third dimension.
At the end of the article, let's talk about virtual machines.
From using VMware to debug programs on various platforms, playing games with various simulators, and using simulators for embedded development, the importance of virtual machines is self-evident. We always hope that fusion or seamless technology will become more mature-with this technology, we can seamlessly use programs on another operating system. I can install a real dual-system with one operating system as the main operating system. When necessary, I can call programs in another operating system without restarting. The most important thing is, it is the running environment of this program, which is actually based on the other operating system, so there will be no wine embarrassment, there will be no VM slowness. In the case of multiple cores, You can have multiple operating systems to use one core separately. This technology can be achieved! But not yet. If there is enough memory, this technology can run as quickly as possible. The current situation is that the development of software cannot keep up with the development of hardware. Even if it has the corresponding computing capability, it cannot enjoy this convenience. One possible assumption is not to build a virtual machine on the application layer or kernel layer, but under the kernel, between bios and booter, and like VMware Tools, in the application layer, there are also echoes, and they work together. Intel and AMD have already supported virtual machines in the CPU. However, I'm disappointed with the performance of KVM, maybe because I didn't use it properly, or KVM is still in its infancy. There is also an Mmix chip that combines the advantages of various computer architectures by knuth. Currently, only virtual machines are available. I hope such virtual machines can be made hardware-based. However, but you have to wait for the real historical process.
However, the virtual machine mentioned in that sentence should not be the virtual machine, but the virtual machine used for language implementation. Chrome uses JavaScript Engine V8 and Mozilla's spidermonkey engine. They are also virtual machines. However, they are virtual machines in dynamic languages and interpreted languages. This involves the automatic state machine ...... I don't know much about these aspects. Just stop.