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

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

Personally, I find dynamic languages ​​like Ruby much simpler.

Reply content:

I think we should not look at static or dynamic, but strong type and weak type.
Strong types are less error-prone than weak types, while weak types just save some code.

Both python and php are dynamic languages, but python is stricter than php in terms of type. For 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 backgrounds ensure that enough people and companies have confidence in these languages, thus promoting the large-scale application of these languages, and then relying on inertia. .
Looking at the growth rate of Python and Ruby in the field of web development, we know that when faced with a problem that is different from the environment that people are familiar with, people will start to re-examine their choices, give up their habits and do Make more reasonable choices.

The most critical point: There are no Python and Ruby courses in domestic universities.

Because static typing is beneficial to tools for static analysis, performance optimization, and code readability
Some people always compare the amount of code used to complete the same task and conclude that Python is better than Java. They have to Said this is a very one-sided view.
Java is a bit verbose, but IDE can help reduce more than 80% of keystrokes. At the same time, static analysis can help solve more than 80% of low-level errors. Code prompts can help reduce more than 80% of document checking time. As for the powerful The refactoring capability is beyond the reach of Python, so as long as it is a slightly larger project, it is likely to be faster to develop using Java than Python.

1. Dynamic languages ​​are relatively slower.
2. When it comes to some large projects, Java/C/C++ can solve problems systematically and more accurately and efficiently.
3. When getting to the lower level When the relationship is closer to the hardware, C/C++ can complete the task better. It can be directly compiled into machine language.
And Python and Ruby need a running environment.
Of course, dynamic languages ​​​​such as Python are used as a tool to process some Daily data is still very useful,
or use Python Django to make a website.

But when it comes to large-scale projects, you need to use Java/C/C++
For example, embedded C needs to be efficient and high Performance, online games use C++ which requires a lot of graphics libraries and calculations,
The banking industry uses J2EE, which is more secure and easy to run on Unix.
There are many practical ones, almost the same, different language tools have different differences The features solve different problems.

Because c and c++ have a long history and were introduced early, they have been widely used for a long time.
As for Java, when it first came out, big companies such as Sun and IBM were fully promoting it, and it has been promoted for more than ten years, until now.
Although ruby ​​and python came out not too late, they did not have commercial promotion from major manufacturers, and it took nearly ten years for them to become known to the public.

Tools are used to solve problems
If they can solve problems better, they are likely to be used more
It does not matter how sophisticated the tool is.

The more complex the project, the use of static language can use the compiler to detect and avoid problems earlier. This is not to say that dynamic languages ​​cannot be used in large-scale projects, but after exceeding a certain scale, the advantages of dynamic languages ​​in being lightweight and flexible will be offset by the overhead during refactoring.

Another reason is performance. In the same way, it’s not that dynamic languages ​​cannot write efficient code, but that you will spend more time on optimization, and if there are more people in the team, the level will inevitably be uneven, which is not as reliable as static languages.

I think it is difficult to find errors in dynamic languages. I often don’t know where the errors are. My personal experience in learning PHP.

If this question had been asked a few years ago, it would probably have been asked the other way around…

Which tool is better depends on the problem it solves, and what technology is popular recently, which can only explain the technology. The applicable problem domain becomes nothing more than a general problem.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/why-are-static-languages-like-java-c-and-c-so-much-more-popular-than-dynamic-languages-like-python-and-ruby-2/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索