Python is slowly fading

Big data abstracts

Source: medium

Compilation: Chen Zhiyan, coolboy

Since its release in the early 1990s, Python has been quite popular. In the past two decades, its popularity has far surpassed C, C#, Java and even Javascript.

Although Python is dominant in the field of data science and machine learning, and even the protagonist in the field of scientific and mathematical computing, it is indeed somewhat lacking compared with languages such as Julia, Swift, and Java.

**Why is Python so popular? **

One of the main driving forces behind the rapid development of Python is that it is fairly easy to learn and powerful to use. For beginners, difficult programming languages like C/C++ will stay away from those who are not familiar with the syntax, so Python is very attractive.

The core of the language is code readability. Python's syntax is concise and expressive. Developers can express ideas and concepts without writing a lot of code (this is also the case in low-level languages such as C or Java). It is very simple and can be seamlessly integrated with other programming languages (such as delivering CPU-intensive tasks to C/C++). Developing in Python language will bring many benefits to developers.

Another reason why Python is widely used is that it is heavily used by enterprises (including FAANG). Today, for any project you can imagine, you can find a corresponding Python package-Numpy for scientific computing, Sklearn for machine learning, and Caer for computer vision.

Weaknesses of Python

**It is slow, too slow. **

Needless to say, speed is usually one of the most important concerns for developers. Not only now, it will be so for a long time in the future.

The main reason for Python's "slowness" can be attributed to the following two points-first, Python is an interpreted language, not a compiled language, which will eventually lead to slow execution time; secondly, it is a dynamic Language (the data type of the variable is automatically inferred by Python during execution).

Beginners often dispute the statement that "Python is indeed too slow". In fact, it is true, but it is not entirely true.

For example, Python's machine learning library TensorFlow is actually written in C++, and it is called in Python. It is a Python "wrapper" implemented on top of C++. This is the case with Numpy, and Caer is a similar form.

Python has a GIL(L)

One of the main reasons for Python's slowness is the existence of GIL (Global Interpreter Lock)-it only allows one thread to execute at a time. Although this helps to improve the performance of a single thread, it limits the parallelism, and developers must implement multi-threaded processing programs in order to increase the speed.

Not the best choice for memory-intensive tasks

When the object goes out of scope, Python will automatically perform garbage collection. Its purpose is to eliminate many of the complexities involved in memory management in C and C++. Due to the lack of flexibility in the specified data types, the amount of memory consumed by Python may explode rapidly.

In addition, at runtime, some bugs may be ignored by Python and eventually become the main incentive to delay the development process.

Far-fetched performance in mobile computing

With the migration from desktops to smart phones, it is clear that people need to build stronger languages for mobile phone software. Although Python has a good performance on computer and server platforms, it often loses its advantages in mobile development due to the lack of powerful mobile computing processing capabilities.

In recent years, (Python) has made great progress in this area, but these newly added libraries are far from their powerful competitors such as Kotlin, Swift and Java.

The rise of other languages

Recently, new languages like Julia, Rust and Swift have borrowed many good design concepts from Python, C/C and Java-Rust ensures memory safety and parallelism at runtime, and provides the same as Web Assembly Interoperability; because it supports the LLVM compiler tool chain, Swift is almost as fast as C; Julia provides asynchronous I/O for I/O (input/output) intensive tasks, and the speed is amazing.

in conclusion

Python is not the best programming language, it cannot replace C/C++ and Java. It was built as a general programming language, emphasizing readability and English-centric grammar. People can use it to quickly develop programs and applications.

Like other languages, Python is just a tool. In some application scenarios, it is the best tool; in another scenario, it may not be. In most cases, it is "very easy to use".

So, as a programming language, will Python die?

I do not think so.

Has it gradually lost its charm?

Ah, maybe just a little bit, just a little bit.

Related reports:

https://towardsdatascience.com/python-is-slowly-losing-its-charm-9ca652726492

Recommended Posts

Python is slowly fading
Python 3.9 is here!
alert! Python is slowly losing its charm!
Why python is popular
Python is short-crawling music
Is python an interpreted language?
Is python an interpreted language
Python is short-world epidemic map
Python is short _SVM test
Is python code case sensitive
What is introspection in python
What is object-oriented in python
What is Python variable scope
What is list comprehension in python
Is there function overloading in python
Python deep copy is not perfect
Python judges that it is empty
Python is a cross-platform language code
What is the use of Python
Is python language free or paid?
Everything in Python is an object
Is python suitable for data mining
Is python crawler easy to learn
Is there an algorithm in python language
What is the scope of python variables
What is the id function of python
What is an anonymous function in Python
Where is the pip path of python3
What system is good for self-study python
What is the prospect of python development
What is a sequence table in Python
Is a number in python a variable type
Why is python suitable for writing crawlers
What is the function body of python
Python is mainly used in which directions
Is there a helper function in python
Where is the directory after python installation