**alert! Python is slowly losing its charm! **
The Swiss Army Knife programming language also has some problems and may be replaced by other languages more suitable for specific tasks.
Since Python was released in the early 1990s, it has caused a lot of hype. Of course, it took at least 20 years for the programming community to realize its existence, but since then, its popularity has far surpassed C, C#, Java and even Javascript.
Although Python is dominant in the fields of data science and machine learning, and to some extent in scientific and mathematical computing, it does have its disadvantages compared to languages such as Julia, Swift, and Java.
One of the main driving forces of the rapid development of Python is its ease of learning and powerful usability, which makes it very attractive to beginners and people who avoid programming because the syntax of languages such as C/C++ is difficult to understand. force.
The Python language fundamentally emphasizes the readability of the code. With its concise and clear syntax, it enables developers to express ideas and concepts without writing a large number of lines of code. Python is very simple and can be seamlessly integrated with other programming languages, which is an added benefit for multilingual developers.
Another reason for Python's versatility is that a large number of companies use it. Today, you can find Python libraries in many fields, which contain almost everything you can think of-for scientific computing, there are Numpy and Sklearn for machine learning, and Caer for computer vision.
But Python has begun to weaken, although this change is very slow.
This may be obvious, speed is usually regarded as one of the focuses of developers, and because some unforeseen time may continue to be concerned.
One of the main reasons why Python is "slow" can actually be boiled down to 2 points-Python is interpreted
rather than compiled, which ultimately results in slower execution time; and it is dynamically typed
(variable The data type is automatically inferred by Python during execution).
In fact, this "Python slow" view often plays a big role among beginners. Yes, it is true. But only part of the reason.
Take TensorFlow as an example, this is a machine learning library provided by Python. These libraries are actually written in C++ and can be used in Python, which to some extent constitute a Python "wrapper" implemented around C++. The same is true for Numpy and Caer to a certain extent.
One of the main reasons for Python's slow speed is the presence of GIL
(Global Interpreter Lock), which can only execute one thread at a time. Although this can improve single-threaded performance, it limits parallelism. In this parallelism, developers must implement multiprocessing programs instead of multithreaded programs to increase speed.
When the object is out of scope, Python will automatically garbage collect. It aims to eliminate many of the memory management complexities involved in C and C++. Due to the flexibility (or lack of flexibility) of specifying data types, the amount of memory consumed by Python can explode quickly.
In addition, some errors that Python may not notice may pop up at runtime, eventually making the development process much slower.
With the huge shift from desktops to smart phones, it is clear that more powerful languages are needed to build software for mobile phones. Although Python is quite representative on desktop and server platforms, due to the lack of powerful mobile computing processing capabilities, Python tends to fall behind in mobile development.
In recent years, many advances have been made in this area, but these newly added libraries are not even close to strong competitors such as Kotlin, Swift and Java.
Recently, newer languages such as Julia, Rust and Swift have suddenly appeared. They have borrowed many excellent design concepts from Python, C/C++ and Java-Rust can almost guarantee runtime memory safety and concurrency, and provide First-class interoperability with WebAssembly; Swift supports LLVM compiler tool chain and Julia provides asynchronous I/O for I/O-intensive tasks, and is very fast.
Python was never built as the best programming language. It has never been built as a language that can replace C/C++ and Java. It is constructed as a general-purpose programming language, emphasizing a human-readable, English-centric grammar, allowing rapid development of programs and applications.
Like all other languages at the end of the day, Python is a tool. Sometimes, it is the best tool. Sometimes not. Usually, this is "okay".
So, is Python dying as a programming language?
**I hardly think so. **
So, has it lost its charm?
Ah, maybe just a little bit, a little bit...
Original source:
https://towardsdatascience.com/python-is-slowly-losing-its-charm-9ca652726492
- - - - - - - End -------