Open source leaders talk about programming languages under Unix

Source: Internet
Author: User

C language

Although the C language has serious defects in memory management, it still Wang Wang in some application fields. C is still a good choice for programs that require the highest efficiency, good real-time performance, or are tightly tied to the operating system kernel.

c good portability also adds points to it. But now a lot of other language portability is getting better, and C's advantage in this area may be gradually lost.

Many existing programs can produce very good C code, such as a parser, gui builder, and so on, and C is also attractive, because the code you need to write is only a small part of the entire program.

By this time today, we'd better think of C as a high-level assembly language on UNIX virtual machines.

Even if other high-level languages are perfectly enough to meet your job needs, taking the time to learn C can still be useful, and it will help you think at the level of your hardware system.

Even today, the best C-language tutorial is still the K&r second edition of the C programming Language, published in 1988.

Summary: The best place for C is its high efficiency and proximity to the machine, the worst place in its memory management hell.

C + +

C + + was originally released in the middle of the 1980 's, when object-oriented language was considered a silver bullet to solve software complexity problems. The object-oriented nature of C + + makes it all the way beyond C, and advocates think C + + will quickly squeeze the previous generation into the gallery.

But history is not so. The reason, at least in part, is attributed to C + + itself. In order to be compatible with C, C + + was forced to make a lot of major design compromises, resulting in the language is too gorgeous, too complex. In order to be compatible with C, C + + does not adopt an automatic memory management strategy, thus losing the opportunity to correct the most serious problems of C.

> Another part of the reason, I'm afraid to count on the object-oriented body. It seems that Oo is not very good to achieve the expectations of the year. I've researched this question and I've found that using OO methods results in a thick layer of bonding between components and a serious maintainability problem. Today, let's look at the open source community, and you'll find that C + + applications are still focused on GUI, games and multimedia toolkits, which are seldom used elsewhere. To be sure, object-oriented is only proven successful in these areas, and the choice of the open source community largely embodies the programmer's free will, not the random direction of the company's management.

Maybe there's a problem with the C + + implementation OO approach. There is evidence that the cost of C + + programs over the life cycle is higher than the corresponding C,fortran and ADA programs. However, it is unclear whether this should be attributed to the OO implementation of C + +.

Summary: The advantage of C + + is that as a compiled language, the combination of efficiency and generics and object-oriented features, the disadvantage is that it is too ornate and complex, tend to encourage overly complex design.

Java

java's design is smart, it uses automatic memory management, which is the biggest improvement, support OO design benefits although not so prominent, but also commendable, compared to C + +, its oo design is small and simple.

java does not have the mechanism to manage the library version, thus formally repeating the mistakes of windows dll hell. In an environment like application servers, this raises a lot of problems.

Is Java better than a language like Perl,python? We are not quite sure that much of it seems to be about the size of the program. Its areas of expertise are essentially python-like, and not as efficient as C + +, and in small-scale, heavily-used pattern matching and editing projects that don't rival Perl. In small projects, Java appears too powerful. We suspect that Python is more suitable for small projects, and Java is suitable for large projects, but this is not a strong proof.

Python

python is a scripting language that can be tightly integrated with C. It can exchange data with dynamically loaded C library modules, or it can be called from C as an inline scripting language. Its syntax is similar to the hybrid of C and modular languages, but there is a unique feature that is to indent the block of statements.

python language is very clean, elegantly designed and features excellent modularity. It provides object-oriented capabilities, but does not force the user to object-oriented design. Its type system provides powerful expressive power, similar to Perl, with anonymous lambda expressions, which makes Lisp hackers feel kindly Python relies on TK to provide a convenient GUI interface development capability.

python cannot be compared with C + +, but in today's high-speed CPUs, the rational use of mixed-language programming strategies makes Python's aforementioned weaknesses effectively remedied. In fact, Python is almost considered the slowest in the mainstream scripting language because it provides dynamic polymorphism. In a small project that uses regular expressions in large numbers, it is inferior to Perl. For micro projects, the shell and Tcl may be better, and Python seems too powerful.

For more new experiences , please try JetBrains's various editing language development tools. There are also 50 percent time-limited snapping and free collar iphone?6, Ipad?air and other good gifts!

Open source leaders talk about programming languages under Unix

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.