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.
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.
**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.
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.
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.
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.
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.
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