Eric Raymond is the leader of the open-source movement and has a deep understanding of Unix development. He presided over the development of fetchmail. His Cathedral and market is regarded as a classic of the open source movement. The following comments are very pertinent in the face of several major development languages. They are excellent comments I have seen in recent years. In particular, the thought "Simplicity is good" he holds in his comments is worth pondering. I have chosen some paragraphs for your consideration.
Raymond is not talking about the advantages and disadvantages of languages in general, but wants to answer a question: how to choose development tools for developing open-source projects under UNIX? I suggest you read the original article.
C
Although the C language has serious defects in memory management, it is still dominant in some application fields. For those with the highest efficiency, good real-time performance, or
C is still a good choice for programs closely related to the operating system kernel.
C's good portability also adds points for it. However, the portability of many other languages is getting better and better, and C's advantages in this area may gradually be lost.
Many existing programs can generate very good C code, such as syntax analyzer and GUI builder. At this time, the C language is also attractive, because the code you need to write is only a small part of the entire program.
Furthermore, we should certainly understand that C language has irreplaceable value for programmers. As for every language I discuss here, as long as you discover it deep enough, you will see that their kernels are written in pure and portable C.
At this time, we 'd better regard C as an advanced assembly language on a Unix virtual machine.
Even other advanced languages can fully meet your work needs. It is still helpful to take the time to learn the C language. It can help you think about problems at the level of the hardware system.
Even today, the best C language tutorial is the K & R Second edition of the C programming language published in 1988.
Conclusion: The best part of C is its efficiency and closeness to machines, and its worst part is its memory management.
C ++
C ++ was initially released in the middle of the 1980 s. At that time, object-oriented language was considered a silver bullet to solve software complexity issues. C ++'s object-oriented feature fully surpasses C, and supporters believe C ++ will quickly squeeze the previous generation of languages into the showroom.
But this is not the case in history. At least part of the reason lies in C ++ itself. To be compatible with C, C ++ was forced to make many major design compromises. As a result, the language was too gorgeous and too complex. To be compatible with C, C ++ does not adopt an automatic memory management policy, thus losing the chance to correct C's most serious problem.
In addition, I am afraid it should be regarded as object-oriented. It seems that OO has not met people's expectations for the year. I have investigated this problem and found that using the OO method causes a thick Bond Layer between components and brings about serious maintainability problems. Today, let's take a look at the open source code community. You will find that C ++ applications are still concentrated on GUI, games, and multimedia toolkit, which are rarely used elsewhere. You know, object-oriented has proved very successful in these fields. The choice of the open source community largely reflects the free will of programmers, rather than the random command of the company's management.
Maybe there is a problem with the c ++ method for implementing oo. There is evidence that the overhead of the C ++ program throughout the lifecycle is higher than the corresponding C, Fortran and Ada programs. However, it is not clear whether this should be attributed to the oo implementation of c ++.
In recent years, C ++ has joined many non-oo ideas, and its abnormal ideas are similar to lisp. The emergence of STL is remarkable.
In fact, the most fundamental problem with C ++ is that it is basically just another traditional language. Memory Management in STL is much better than the previous new/delete and C solutions, but it still does not solve the problem. For many applications, its oo feature is not obvious. Compared with C, it does not gain many benefits except for increasing complexity.
Summary: The advantage of C ++ is that, as a compilation language, it combines efficiency with generics and object-oriented features. Its disadvantage is that it is too gorgeous and complicated and tends to encourage overly complicated design.
Java
Java design is very clever. It uses automatic memory management, which is the biggest improvement. Although the benefits of supporting OO design are not so prominent, it is also very commendable. Compared with C ++, its OO design is small and simple.
Compared with python, Java has some obvious mistakes. In some cases, the design is still too complex, or even flawed. Java class visibility and implicit scoping rules are too complicated. The interface mechanism is designed to avoid problems caused by multi-inheritance, but it is still difficult to understand and use it. Internal and anonymous classes lead to confusing code. The lack of an effective destructor makes it difficult to manage other resources (such as mutex and lock) except the memory. Java threads are not reliable, and its I/O mechanism is very powerful, but reading a text file is very cumbersome.
Java does not have a mechanism to manage the library version, and thus forms the same as windows DLL. In an environment similar to an application server, this causes a lot of problems.
In general, apart from System Programming and highly efficient programs, Java is superior to C ++ in most fields. Experience shows that Java programmers seem to be less likely to construct excessive oo layers like C ++ programmers, but this is still a serious problem in Java.
Is Java better than Perl or Python? We are not very clear, and it seems to be related to the program scale to a large extent. Its expertise is basically similar to that in Python. It cannot be compared with C/C ++ in terms of efficiency, and it cannot match Perl in small-scale projects that use pattern matching and editing. In small projects, Java seems too powerful. We suspect that python is more suitable for small projects, while Java is suitable for large projects, but this is not proven.
Python
Python is a scripting language that can be closely integrated with C. It can exchange data with the Dynamically Loaded C library module or call from C as an embedded scripting language. Its syntax is similar to the combination of C and modular languages. However, it has a unique feature, that is, to determine the statement block by indentation.
The Python language is very clean, elegant in design, and has excellent modular features. It provides object-oriented capabilities, but does not force users to design objects. Its type system provides powerful expression capabilities, similar to Perl, with anonymous lambda expressions, which makes lisp hackers feel friendly. Python relies on TK to provide convenient GUI development capabilities.
Among all interpreted languages, Python and Java are best suited for multiple programmers to develop large projects collaboratively in a gradual manner. In many aspects, python is simpler than Java, and it is very suitable for building a rapid prototype, which gives it a unique advantage for Java: for those that are neither complex, python is suitable for programs that do not require high efficiency.
The speed of Python cannot be compared with that of C/C ++. However, in today's high-speed CPU, the rational use of mixed-language programming strategies can effectively compensate for the above weaknesses of Python. In fact, python is almost considered to be the slowest of mainstream scripting languages because it provides dynamic polymorphism. In small projects that use a large number of regular expressions, It is inferior to Perl. For micro-projects, Shell and Tcl may be better, and Python may seem too powerful.
Conclusion: The best thing about Python is that it encourages clear and easy-to-read Code and is especially suitable for constructing large projects in a progressive development mode. The disadvantage is that it is not efficient, too slow, not only slow compared with the compilation language, but also slow compared with other scripting languages.