Home  >  Article  >  Java  >  Masters analyze mainstream programming languages ​​such as Go, Java, and C for you

Masters analyze mainstream programming languages ​​such as Go, Java, and C for you

黄舟
黄舟Original
2017-01-18 15:15:341560browse

Java Programming Language

Java is an object-oriented programming language that can write cross-platform application software. It is a Java programming language and Java platform launched by Sun Microsystems in May 1995. (That is, the general name of JavaEE(j2ee), JavaME(j2me), JavaSE(j2se)).


This article mainly analyzes C, C++98, C++11, Java and Go, and mainly discusses the key capabilities of the language. In the process of discussion, we will combine the exchanges between Huawei's language programming experts and key developers within Huawei's telecommunications software. We will abandon the disputes over language preferences or language sects and try to discuss the characteristics and shortcomings of each language from an objective and fair perspective. Language selection serves as an objective reference.

Write these out and hope to get everyone’s corrections and feedback to make the entire analysis more objective. In terms of performance, I will focus on in-depth analysis and reference of Go. There’s a lot of content and the expectations won’t put you off.

Overall overview of the language

1. Go

In terms of concurrency, the goroutine and channel mechanisms provide a lightweight and smooth concurrency mechanism at the language level; in terms of performance In terms of performance, it provides performance that is not inferior to Java (performance is a false proposition). In terms of memory resource consumption, it has obvious advantages over Java and other dynamic languages. In terms of syntax, it has some of the dynamic language features of Python. In terms of object Initialization, construction and serialization provide extremely concise expressions, and these processing codes may account for 10% to 50% of the code, especially for data processing, configuration and protocol mapping scenarios. Compared with C, C++, and Java, This aspect is clumsy, which is the key to why dynamic languages ​​are so fascinating.

This is also the key reason why the first version of the Go language attracted so much attention when it was released, especially for dynamic languages, it provides concurrency and performance advantages that dynamic languages ​​do not have, Pike The purpose of designing the Go language is to serve as another optional role for C/C++ (note that it is not a replacement, and its design goal is not to replace it). Pike, the father of the Go language and chief software engineer at Google, stated this in his 2012 "Dao to Simplicity" speech. Goal is full of frustration, and one of the quotes: "Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages ​​like Python and Ruby. Very few come from C++." The essence of C++'s value is that the language provides more Extensive abstraction, elegance and flexible features, and these expression capabilities are at zero hardware cost. The C language has zero hardware cost as its design goal from the beginning, but the language expression ability is solved by C++, and the direction of Go's thinking is obviously not Zero cost, at least not zero CPU cost, Go's proposition is more about minimizing the programmer's workload.

One is the ultimate pursuit of zero-cost hardware, and the other is to minimize the programmer's workload. No one can replace anyone's most valuable part. Go cannot meet both goals at the same time. It chooses dynamic syntax and gc is destined to choose development efficiency and sacrifice hardware efficiency for development efficiency, so it goes in another direction, which is the application direction that Java is good at, especially the current network and HTTP applications, which requires good Standard library and ecosystem support. In terms of standard library, Go has provided a more lightweight and excellent code library for processing tcp/http/xml/json/encryption and decryption, etc., as well as high concurrency support for http, the core protocol of the network. It has been provided with a stepping stone to leveraging Java.

But we must face its current shortcomings. It is far from mature in terms of important language features and rigor, and there are still many faults or temporary solutions, which will also affect the maturity of its ecology. However, these problems still need to be solved in the new version. The first version of the Go language was officially released on March 28, 2012. Up to now, version 1.7 has been released. Two major versions have been released in almost a year, with several beta and RC versions released in between. This basically shows that the Go language is not yet complete. get ready.

Summary

Go has proven to be an ideal candidate for Python and Ruby in terms of dynamic language performance requirements; in terms of application development, especially HTTP-related applications, it is currently at the forefront. A challenger in front of Java, and also provides another role besides C/C++ in places where the control of resources is not so strong.

In terms of productivity, its language features and ecosystem are not yet mature, and the version is still being rapidly iterated. Compared with dynamic languages ​​and Java, it does not have any advantages. At this stage, these languages ​​​​are limited in certain scenarios. Optional roles. In the long run, with the strong support of Google, new features and library application capabilities will continue to be added. It is a thriving programming language. However, at this stage, it is recommended that the scale and complexity of the program must be controlled. The language and ecology have not yet been fully developed. To provide sound support, we must also be aware of the risks caused by its immaturity and rapid version iteration.

2、Java

The success of Java was due to the strong support of large companies such as SUN, IBM, and Oracle, which were mainly based on Unix systems 10 years ago, which allowed it to gain a firm foothold in the field of enterprise applications and WEB applications, and in the subsequent 10 years In the first half of the year, it relied on the revolution brought by x86+Linux to continue to maintain its share. In the second half, it was the success of android that allowed it to reach the top again after faltering and stopping. In the past two decades, Java has accumulated the most powerful ecosystem. You can say that it is all-encompassing. There is no doubt that Java has long been a huge body of an aircraft carrier, which is enough to prove its status and success. However, the complexity of its language, libraries, frameworks and ecosystems poses huge obstacles to technicians, such as concurrency, the language's synchronized mechanism, the standard library's notify and then concurrent, and HTTP can also be obtained through the Apache+tomcat container And based on JVM technology, Java has good interoperability with other languages, such as Scala in terms of concurrency. You can choose its Actor or Akka, which is also written in Scala. Of course, the industry chooses nginx and other hybrid scenarios for more. Too many...

This is the world of Java. There is never too much, and there is no need to reinvent the wheel. This is the key to the success of Java. It has been precipitated by history, and Java provides too many options. After in-depth study, you will know that the learning cost of Java is higher than that of C++, and the requirements for programmers are higher than C++. Unless you are left behind and are still using Java technology 7 or even 10 years ago, technical personnel must organize the framework and design very carefully. , otherwise the result of various reuses will be an extremely bloated program, whose resource consumption during runtime will sometimes scare you, and this is the key reason why too many platforms developed based on Java are widely criticized. , Reuse is a double-edged sword. It needs to be tailored rather than one-size-fits-all. The scale is undoubtedly the most demanding for developers, unless the language and standard library provide the best and most direct options.

Summary

Java has long proven that it is all-encompassing. In the past ten years, it has basically been the best-ranked language and accumulated the most powerful ecosystem. To clarify the next misunderstanding: Today, the learning cost of Java and the skill requirements for developers are much higher than those of C/C++. Perhaps most developers cannot control the aircraft carrier of Java. If you want to use Java for a long time, you must keep up with the latest technology of Java. At the same time, you must have a good sense of reuse. This will place higher requirements on personnel skills. Otherwise, it will be extremely easy to write resource occupancy and runtime efficiency that will be scary. Applications.

3, C, C++98, C++11...

C/C++ still occupies a solid position in embedded and system-level programming, because such programs as Java and The key focus of languages ​​such as Go is obviously on the side of development efficiency. Please refer to the discussion in the previous chapter on Go.

However, in terms of concurrency, network and application programming, it has been in a dark age of secrecy. The language itself does not provide any support, and the standard library that is too thin has no ambition in this regard. The C/C++ standard I am afraid that the size of the library will never be comparable to Java and Go, because C/C++ is not controlled by any large commercial company and is completely "free-range". The standard library needs continued investment from large commercial companies. This is why C++98 It took 13 years for the standard library to receive a major update. This directly led to the need for C/C++ to encapsulate the system APIs of various hardware platforms. Before linux+x86 defeated Unix on a large scale, numerous Unix systems made cross-platform programming more difficult. Before 2000, a very bad cross-platform program appeared. ACE, and the equally bad MFC library on the Windows platform that is full of macro static global variables. These were once regarded as life-saving straws by programmers. These technologies were obviously quickly abandoned by history. Now you can understand why there are so many People are afraid of C/C++ being secretive. At this time, Java provided standard libraries for multi-threading, network and application development and cross-platform support based on JVM technology, pushing Java into a mainstream programming language, which was the key to Java's success in the first ten years.

For C/C++ programmers, there is an exciting event. C++11 is released. Compared with C++98, it is a huge leap forward in terms of language and standard library. C++ It is not an exaggeration to say that the father of C++ is a new language. At the same time, the contributions of so many top C++ experts to the boost library (which is actually a real-time standard library) have already made a huge difference in terms of networking, concurrent programming, and some basic applications. It provides the library with the best performance, which greatly reduces the difficulty of development in this area. Traditional C++ programmers need to transition to C++11 as soon as possible, which requires the update of the compilation environment, and the update of the compilation environment will bring the most powerful tools for memory detection and performance analysis. CC++ was once the most widely criticized memory. Regarding cross-border and leakage issues, in the face of gcc5.2 version and Intel's latest CPU, memory failure can be caught at the first scene. At the same time, the vtune performance analysis tool provided by Intel is the most powerful tool I have encountered so far.

summary

Traditional C++ programmers should transition to C++11 as soon as possible and embrace the new standard library and boost. This will greatly improve the efficiency of development and maintenance in embedded and system-level programming. A new language must be embraced, and a major upgrade of the language is also a new language in a broad sense. It must also be placed in an equally important position to better utilize the effectiveness of existing assets. In terms of application development, since the standard library does not expect it to be able to compete with Go at the current stage, let alone Java, so it should honestly do its best in the areas it is best at.

Language Features

1. Concurrency

Go has the greatest advantages in lightweight and simplicity: the goroutine and channel mechanisms provide lightweight and smooth language-level Concurrency mechanism, the standard library also provides application libraries based on this;

In terms of hybrid programming in the concurrent world, Java provides the most choices and ecological support: after the release of java.util.concurrent ten years ago It has pushed Java to the peak of concurrent programming. Under the cloud, Java has good interoperability with high-concurrency frameworks and languages ​​such as Scala;

C++11 compared to C/C++98, A big step forward, the standard library and extension library boost library have provided excellent cross-platform encapsulation, saying goodbye to the maintenance of operating system APIs, just like the release of Java's concurrent package 10 years ago, which greatly reduced the cost of this language There is a mental burden across platforms in terms of concurrent programming, but in terms of thread scheduling and management, you still need to carefully maintain it yourself;

For C/C++98, only Huawei telecom software relies on SNE /ENIP, some rely on ACE, and some have their own cross-platform packages with different styles. Especially 10 years ago, it had to support windows, linux, solaris, aix and other platforms. In the dark age of concurrent programming, the difficulty of developing C/C++ was mostly due to its Concurrency and network programming are not supported by languages ​​and libraries, so you have to start from scratch.

Summary

Development difficulty Go

2. Object-oriented

Java, C++, and Python all provide good object-oriented language support. With support for design patterns, type systems, and tool chains, Java and C++ have the ability to build The basic elements of large-scale programs; although the Go language claims to support object-oriented, it is indirectly simulated through methods and interfaces, etc., and cannot directly and clearly organize the object structure and initialize and destroy them. Like C, it will be filled with a large number of global objects. and structures, the cost of managing objects is relatively high. In terms of building large-scale programs, the language capabilities are still relatively weak, and new language features need to be added.

3. Physical structure organization

The organization of physical structure plays a more crucial role for medium and large-scale programs than the expression of logical structures such as class interfaces, such as There are about 1 million lines of C++ code. If the structure is not well organized, the impact will be at the strategic level (the impact of logical structure organization on large-scale programs is at the tactical level): for a single line of code change, the compilation and linking time may be more than 10 minutes, or even several hours. , just the time spent compiling and restarting may have defeated the entire development efficiency.

Package: In terms of code organization, the role of packages does not need to be elaborated. Java and Go are basically born with this language feature, while C/C++ obviously does not have it. C++ only has a relatively weak name. space to avoid name conflicts (more about logical structure organization), and more about organizing code classification through directories, header files/source files/HPP files, which need to be handled and designed very carefully, otherwise the introduction of cycles and confusing dependencies is commonplace , the organization of large-scale programs requires higher personnel skills.

Library: In terms of program running, Java supports dynamic loading of jar packages and has good expansion and upgrade capabilities, while C/C++ supports both static and dynamic linking methods, but in terms of loading methods, there is basically no The control is not as flexible as Java. After Go is compiled, it basically only relies on the libc library under Linux. It does not support dynamic linking and only supports static linking. Finally, an execution program compatible with gdb format is compiled and has a minimalist configuration in terms of deployment. However, the program size must be controlled, otherwise it may cause linked upgrades in the operating domain.

Summary

Java is the best in this regard, while C++ must be handled with caution, and Go is somewhere in between.

4. Type system and generics

Java/C++ both support strong type compile-time detection, providing compile-time type safety to facilitate the discovery of low-level type errors, and support generics to facilitate the expression of general algorithms and containers; the Go language supports Python's dynamic syntax , the code is more concise in processing type declaration definitions, but it is slightly weaker in terms of types. Generics are not supported at this stage, which brings great obstacles and type insecurity to the expression of general algorithms and containers, and requires interface {} To simulate, just like void * in the C language world, or Java without generics 10 years ago, its objects all inherit from Object. Of course, interface {} is not just an object or data structure type. The history of Java has proven that this road will not work. Sooner or later It will reach generics, so the Go language does not support it at the current stage. It should be supported in the long run. Its inventor also said that no good support method has been found yet.

Summary

Go still needs new features at the language level. I believe this will happen sooner or later. In terms of generics, among the current languages, C++11 is the best. , followed by Java, and C++98 often suffers from obscure and extremely difficult syntax errors when dealing with generic types.

5. Initialization

Initialization is a crucial link for the robustness, flexibility and readability of the program. The program cannot assign values ​​to variables well in various complex scenarios. The results can be imagined.

Java does a better job, with good gc, object-oriented, does not support global variables, data members support phased initialization, and there are clear initial values ​​for undisplayed assignments, and it can also be used during class loading. Control complex dependencies between classes and jar packages.

C's language support in terms of initialization is the most primitive, and in a derogatory sense it is the "worst". It does not support object-oriented, global variables, free functions and initial values ​​without clear meaning bring a lot of Procedural issues.

C++ has better support and is object-oriented. Among these languages, it is the only one that supports object destruction and RAII. It has the strongest control over the initialization management between complex objects and object collaboration, while C++ +11 Introduces dynamic features such as auto and decltype to make C++ perform better; but it is also compatible with the poor initialization of C language. If you use C++ like C, the result will be the same as C language, and this may be very common. This This is also where C++ is criticized. This is one of the negative aspects of inheriting C language assets. It can be done very well, or it can be done very, very badly.

Go In terms of initialization, Go borrows part of the dynamic language from Python. In terms of structures such as variables, arrays, structs, lists, and maps, I believe everyone who has seen it will praise its simplicity. But more versions are still needed to mature: gc has been greatly improved compared to the version before 1.5. It currently does not support construction and destruction, and defer simulates it to a certain extent, but compared with C++'s RAII and Java objects , finally and other mechanisms are not yet mature, and it is easy to introduce defects such as performance and resource leakage; initialization is not uniform, and various initialization methods in specific fields such as New, make, {}, etc. also expose the language design of Go. On the mature side, you must know that Java, C++, and C only require one new or malloc.

6. Error handling

Error handling is crucial for the organization of complex logic and the robustness of the program. For example, for a simple file reading, C language processing requires opening the file and judging Open the result; read the data, judge the result of reading the data; map the data into an object, judge the result of each parameter..., you will know how cumbersome error handling is.

Sound programming languages ​​such as Java/C++/Python/C# undoubtedly give exception handling the first priority. Unfortunately, Go does not currently support it. Instead, it uses multi-value return error codes or the panic-recover mechanism to fill the entire logic with error handling code. Compared with C's error return, it may sometimes be worse.

7. Dynamic syntax

Why should dynamic syntax be regarded as a key item? I believe that those who have used Python, etc., regardless of other operating efficiency factors, will undoubtedly find its simplicity refreshing, especially It's in object initialization and construction, and this is where 10% or even 50% of the program code may be, especially for systems that deal with data, configuration, and analysis.

Go borrows part of Python's dynamic syntax. With the cooperation of reflection, it is a big improvement compared to the clumsiness of traditional JAVA and C++. Of course, this aspect still needs continuous improvement, especially strings and types. In terms of compatibility, there are still many gaps. There is no doubt that in terms of data processing, Go is a better choice compared to Java, C++, and C.

8. Other important language features

Operator overloading is undoubtedly the most elegant for scalable type operations; function overloading is useful for incremental maintenance development and supporting various simple calls. It is said that it is also indispensable; lambda is already a required option for the sound general language C++11/Java/python/C#. Lambda is undoubtedly a powerful tool in terms of data initialization and control logic expression... Go language is not yet Supporting these important syntax features requires enhancements in subsequent versions.

Ecology

1. Standard library

Java’s standard library is undoubtedly the most mature and powerful. It provides ready-to-use highly reusable classes and libraries without the need to reinvent the wheel. This is the key to Java’s success, but the development of Java So far, its language, class libraries and frameworks have already become an aircraft carrier, and new technologies and new libraries are constantly emerging around its JVM. The learning cost of mastering it is the highest. Many Java programmers are actually falling behind, just like C++. Similarly, you may still be using Java technology from 7 or even 10 years ago. In the field of Java applications, you must keep up with the pace of new technologies, and at the same time organize the framework and design very carefully, otherwise the result of various reuses will be an anomaly. The consumption of resources by bloated programs when running can sometimes scare you, and this is the key point that some platforms are widely criticized for. Reuse is a double-edged sword. It needs to be tailor-made rather than just one-size-fits-all. The scale required for developers is Undoubtedly the most expensive.

In addition to providing basic capabilities similar to the C++11 standard library and boost library, Go also provides excellent libraries that support concurrency in terms of application libraries, especially network and WEB programming. If you have C++ application capabilities Scared by the weakness and hugeness of java, there is no doubt that Go is a good choice to face.

C++11, concurrent programming, etc. have been incorporated into the standard library. At the same time, the real-time standard extension library boost undoubtedly provides basic application reuse capabilities. C++11 is doing cross-platform concurrency and network applications. In terms of programming, it can completely replace the traditional C/C++98, taking a big step forward in the dark ages. However, in terms of enterprise application development such as WEB, database and data analysis, the C++11 library is still very thin.

2. Tool chain

The tool chain of C/C++/Java does not need to be described in detail. It can jump from the editor, code browsing, debugging, automatic generation of code documents, and complexity measurement. , find bugs, memory troubleshooting, performance monitoring, etc. are already very authentic. Huawei's CI environment also provides good support, so I won't go into details.

Focus on the Go language. The development environment usually chooses Eclipse or LiteIDE. Choosing Eclipse will cause a lot of troubles. Due to the Great Wall, plug-ins cannot be obtained directly: Go projects require GoEclipse, and code jumps require gocode and code. For debugging, you need to install gdb. These are downloaded separately. To be more robust, you need to install guru and godef. Some require compilation and a sound environment of Go with Eclipse installed. Depending on your personal situation, it will take about 0.5 to 2 days to work, so it is recommended. LiteIDE is basically included in its package, and you can almost use it after installing it. However, these environments can only be used simply, and many important experience problems will be encountered during development work, as follows:

Lack of important experience in editing and reading

Code browsing: objects, functions, and variables without code The global browsing and search functions can only be opened one by one to view. For large projects with many files and large files, if you are used to Eclipse, source insight and .net, you will go crazy without browsing; code search and jump: Names cannot be printed, function class interfaces, etc. can be automatically listed, and the forward and backward jump functions are basically unavailable, which is a major experience loss for large projects; other important experiences: no refactoring tools, no automatic code generation tools, and compilation errors. You can’t just do whatever you want...

Lack of important code debugging experience

Windows debugging relies on gdb. Gdb is not very reliable in the windows environment, so don’t expect it to work well as expected in the windows environment. It is best to debug in the Linux environment, or write print to the console. If you are accustomed to the Windows environment, you may have to adapt to the new non-graphical environment.

Lack of dynamic and static detection tools

Lack of cyclomatic complexity, codex suite security check (can directly call C/C++ code), memory check (can directly use pointers and call C code).

Summary

It is basically usable, but some important experiences that improve efficiency are lost. At this stage, if the development environment of Java/C++ is given 5 points, the Go environment can only be given 2 points. , and Go has almost 2 major versions a year, which is also an important challenge to the development environment (Java/C++ even uses the environment 5 or even 10 years ago). The company still has a lot of work to do, and it must quickly control its versions. The impact of switching caused by iteration. One of the purposes of Google's early open source before it matured is to expect the industry to provide more tools, and the tools are basically contributions from the open source world. Android is developed based on Java, so Google can use it directly, and Go, as a A completely new language, Go currently falls short in terms of development environment.

3. Language popularity and open source project analysis

When it comes to language, the rankings of TIOBE, PYPL and GitHub will inevitably come to mind. Let’s take a look at their data:

TIOBE Data

The popularity of a language must be determined by the authoritative TIOBE world language rankings. The latest data rankings in June 2016:

Masters analyze mainstream programming languages ​​such as Go, Java, and C for you

The latest ranking of the new language Go is 48th, and the popularity gap with Java is 100 times. Two years ago in July 2014, the Go language ranked 30th, with an index of 0.222%. In July 2015, Go was not ranked in the top 50. The rankings in the most recent May of 2016 were: 50+, 38, 48, 44 and 42. .

Language popularity rankings in the past thirty years:

Masters analyze mainstream programming languages ​​such as Go, Java, and C for you

PYPL’s latest data

Masters analyze mainstream programming languages ​​such as Go, Java, and C for you

##GITHUB data

Open source community, select the most representative open source language rankings on github:

Masters analyze mainstream programming languages ​​such as Go, Java, and C for you

Comments

Mainstream programming languages ​​have always had strong vitality. Java, C, C++, C#, Python, JavaScript, and PHP have never left the top ten according to the data of the past ten years. Other languages ​​​​play is an optional role in some cases. Note that it is not a replacement for these mainstream languages, because there are currently no signs of their decline.

Java has always been the king in the past ten years; C/C++ has always had a stable position, always occupying a dominant position in embedded and system-level programming, and in terms of dynamic languages; Python's simplicity and ecology make it the glue Of course, the role of language can also be used to write server-side programs that are not so demanding on performance; as for websites, PHP and JS needless to say, 70% of websites are still written in PHP.

The official version of Go in 2009 was two years away from release and it caused a wave of enthusiasm. As the father of the Go language said, it created another role, one when Python/Ruby needs performance. Optional role; compared to Java, it creates a more lightweight and more efficient role, providing a stepping stone to leverage the prehistoric monster Java, but the maturity of the language, standard library and tool chain involves key In terms of productivity, it is not ready yet. In terms of performance, as a new language, its scheduler is not ready either. There are still many performance traps. See another article to discuss them separately.

4. Industry Application

As for Java, C, and C++, it has been explained earlier that in terms of productivity, Java is already an all-encompassing aircraft carrier, while in terms of demanding performance, C/ C++ remains firmly entrenched. For Go, it has indeed been proven that it is an option for scripting languages ​​​​such as Python and Ruby when performance is required, and these dynamic language scripts are basically used in the management domain: monitoring and deployment of environmental resource applications, etc., and some use them for Server-side development, and when performance is critical, these languages ​​​​are indeed not good at it; in the areas where Java/C/C++ are good at, there are too many successful applications. Go is in some scenarios, such as data analysis or HTTP applications. In terms of aspects, it is an optional role, and in general and complex application business domains, regardless of language, ecology and maturity, it is not ready. Go still has a lot of work to do and more iterations to do.

A brief introduction to other mainstream languages ​​in the industry

Python/JavaScript/C# In the past ten years, it is also one of the most popular languages. Like the Java/C/C++/PHP language, it dominates its respective fields. , and these languages ​​​​are more or less used in departments, but due to non-business modules, the emphasis is not so high. In fact, pages, tools and management domains involve important experience issues, and still need to be paid enough attention, otherwise the accumulated code If there are more, maintainability and experience will bring an increasing burden.

1. Shell/Python

Historical legacy and its inertia, in terms of installation, deployment, upgrade and monitoring management tasks, c shell or b shell scripts are basically still used. The syntax of shell is deep. It is obscure and has extremely poor readability. At the same time, the editing and debugging environment is the most primitive, and the development and maintenance efficiency is basically the lowest. However, these non-business components are usually ignored, and there is a lot of accumulated code, which requires dedicated personnel. Familiar with shell maintenance. Python is the simplest and most productive language among the languages ​​listed in this article when it comes to handling strings, containers, and environments.

It is recommended to use Python for scripts in the operating domain as much as possible. In the management domain, the name of the glue language is unmatched, and Python is basically among the top five languages ​​​​in the rankings.

2. JavaScript/Typescript

JavaScript can be said to be the most popular web scripting language, but its design has two flaws that have been criticized. One is too simple; the other is weak. Type, syntax errors will not be discovered until runtime. I guess no one has encountered a situation where a warning box pops up on a web page for unknown reasons. When the JS code exceeds 10,000 lines, its simple syntax and weak typing will bring a huge burden to the maintainers. I have only written a few hundred lines of JS pages, and I can't stand weak typing. I have also downloaded Sina.com before Looking at the JS code of a complex portal website, to be honest, if you can’t go deeper, you just give up. Typescript appeared precisely to solve these two design flaws of JavaScript.

For Typescript, maybe if you are used to JavaScript, you will reject its object-oriented and other language features that enhance expressiveness, thinking that it makes simplicity complicated. But another feature is to add compile-time type checking to JavaScript for free. I believe no one will reject such a feature, just like writing an article to point out the wrong approach. Therefore, those who write JS pages should switch to the superset of TS.

3、C

#

C# is even more niche in Huawei, but it is also one of the most popular languages. The one that can really challenge Java’s status is C#. Unfortunately, Microsoft confines it to Windows systems, which also limits the world’s top languages ​​and compilers. Due to the influence of the Danish machine expert Anders Hejlsberg, C# is currently gradually moving toward open source. At the same time, it relies on the most powerful integrated environment currently. NET is also moving toward open source.

The above is the analysis of Go, Java, C and other mainstream programming languages ​​for you. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn