Why are static languages like Java, C, and C ++ much more popular than dynamic languages like Python and Ruby?

Source: Internet
Author: User
I personally think that dynamic languages like Ruby are much simpler. I personally think that dynamic languages like Ruby are much simpler. Reply content: I don't think it should be static or dynamic, but strong or weak.
A strong type is less prone to errors than a weak type, while a weak type only saves some code.

Both python and php are dynamic languages, but the python type is more rigorous than php. Example:

a = [1, 2, 3];print(a['1']);b = {0:1, 'a':2};print(a['0']);
C/C ++ has a strong academic background, and Java/C # has a strong business background. These background ensures that there are enough people and companies with confidence in these languages, this promotes large-scale application of these languages and then relies on inertia.
Looking at the growth speed of Python and Ruby in the web development field, we can see that it is suitable for a problem that is different from the environment that people are familiar, people will review their choices and give up their habits to make more reasonable choices. The most critical point is that Chinese universities do not have Python or Ruby courses. The static type facilitates static analysis by tools, performance optimization, and code readability.
Some people always compare the amount of code used to complete the same task and come to the conclusion that python is better than java. I have to say this is a very one-sided view.
Java is a bit cool, but ide can help reduce keyboard hitting by more than 80%, static analysis can help solve more than 80% of low-level errors, and code prompts can help reduce the time of searching documents by more than 80%, as for the powerful refactoring capabilities, python is far from perfect, so as long as it is a slightly larger project, java is likely to be faster than python. dynamic Language is relatively slow.
2. When it comes to some big projects, Java/C ++ can solve the problem more accurately and efficiently systematically.
3. When the relationship between the lower layer and the hardware is closer, C/C ++ can better complete the task and directly compile it into a machine language.
Python and Ruby need to run the environment.
Of course, Python and other dynamic languages are used as a tool to process some daily data,
Or use Python Django as a website.

However, Java/C ++ is required for a large project.
For example, Embedded C requires high efficiency, and online game C ++ requires a large number of drawing libraries and operations,
The banking industry uses J2EE, which is highly secure and easy to run on Unix.
In fact, there are quite a few of them. Different language tools have different features to solve different problems.
Since c and c ++ have a long history, they have come out early, so they have been widely used for a long time.
Java, when it first came out, was promoted by major manufacturers such as sun and IBM for more than a decade until now.
Although ruby and python are not too late to come out, there is no commercial promotion in large factories. It has been a matter of nearly ten years for the public to be familiar. The tool is used to solve the problem.
A better solution may cause many problems to be used.
Instead of saying how sophisticated the tool is, the more complex the project is. Using static languages, you can use the compiler to discover and avoid problems earlier. This does not mean that dynamic languages cannot be used in large-scale projects. However, after a certain scale is exceeded, the advantage of lightweight and Flexible Dynamic languages will be offset by the overhead during reconstruction.

Another reason is performance. Similarly, it is not that dynamic languages cannot write efficient code, but that you spend more time on optimization. When there are too many team members, it is not as good as static languages. I think it is difficult to check for errors in dynamic languages. I often don't know where the errors are. I personally learn PHP. If I put this question a few years ago, I would probably ask it again ......

Which tool is good depends on what the problem is to be solved and what technology is popular recently. It only shows that the problem domain of this technology has become a common problem.

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.