Python 3 is destroying Python

Source: Internet
Author: User

For the Python community, Python 3 is the worst thing. I still remember that when I used Python for the first time, I had been engaged in the C ++ field for a long time. Python is like a bible for me. I can open a text editor. After a few seconds or several minutes, a program that can work properly is born, instead of spending hours or days. I still remember that many useful new features were added when Python 2.5 came out. I love Python, but at the same time I admit that she has shortcomings, but I still can say that all languages have shortcomings. Her advantage is that she is very interesting. Although Python 3 has some minor improvements compared with Python 2, she has lost many advantages of Python 2.

One of the most important advantages of Python 2 is that it has a large number of third-party libraries that can be used to do anything, but Python 3 does not. It is true that many libraries have been transplanted to Python 3, but more libraries are not transplanted and are not easy to transplant. For example, you need to parse X, but X is not as easy to parse as YAML and JSON. There may be a third-party parser to choose from, but only Python 2 can be used, and there is no porting version for Python 3. In addition, the functional differences between the byte string (str) in Python 2 and the bytes in Python 3 make it more difficult to transplant. In fact, porting it is very difficult and requires a lot of tips (trick) to be compatible with Python 2 and Python 3. Therefore, you have two options: Use Python 2 (a language not recommended) to quickly develop your program, however, it takes you more than 10 times to port the relevant libraries (and all dependencies ). Alternatively, you can use another programming language that also has many libraries, but you don't have to worry about the problem between Python 2/3. The second option is obviously not welcome, because if we do this, there are already many Python 3 programs in our production environment and most Python 2 libraries need to be transplanted. Whether or not these situations exist, people either continue to use Python 2 to develop programs, or choose another language that does not show their faces.

Another advantage of Python 2 is that programs written with it can run in the next version without any changes. If your software is based on Python 2, it may take a lot of money to migrate it to Python 3, because the project you need may be quite large, and filled with various class library manuals, but they cannot be migrated. This is unwise in terms of business strategies, because you have to spend a lot of money and engineers time migrating your project to Python 3. You may ask other people to migrate the entire code to Ruby, or it is more cost-effective. So far, if you have to rewrite your software, will you still choose Python 3? No.

Most popular libraries that support Python 2 and Python3 are written through the language subset (subset) running on their respective platforms. SQLAlchemy, one of my favorite Python libraries, is doing well, and Django does the same, but it is a little inferior. A subset of languages, I call it Python X, is not so easy to use. It requires a weird hack and generally has a lower performance than Python2 or Python 3. Is it interesting to port an existing Python 2 library to Python X? There is no taste, but it is sad because it is interesting that makes Python today.

Unfortunately, Python 2 is not recommended, and Python 3 is rarely used. Python 3 has a small change, but it has lost a lot. In the past few months, I have used Python 3 to write programs and services. I personally do not boast about it). There is not much difference between writing programs with Python 2, except for a few third-party libraries. Nothing else is really bright. The Python community was supposed to be transferred to Python 3 over the past few years, but they gradually found that people are switching to new or improved old languages ). Most of these languages have great functions, such as powerful type systems, pattern matching, better performance, better support for threads and high concurrency, simpler FFI, and better lambda expressions.

One solution is fork Python 2.7, and continue to develop it, adding new features in a backward compatible manner, so that most Python 2 applications that cannot be transplanted can continue to evolve and improve, it also brings value to people and companies that spend a lot of time developing it. This is the right thing. In fact, it would be better if leaders in Guido and other Python communities do this in the official name rather than force fork ). Python 3 needs to be ported back to Python 2 and Python 2.8 needs to be released. For a few people who are already using Python 3 development programs, you can use tools like 3to2 to be compatible with Python 2.8. Later, Python 3 can gradually exit from the background, so that the maintainers of those Python libraries can use Python 2 instead of Python X.

Although there are still some other solutions, the revival of Python 2 is obviously what we should do now, and nothing else is worth mentioning. Because the official owner is very disdainat to Python 2 users, don't expect them to revitalize Python 2. If the Community does not refresh and refresh Python 2, Python 3 will become a standard for Python in a few years, and many corresponding class libraries will be connected, although most of them will never be possible ), A lot of investment will be lost. By that time, the whole community will obviously shrink and lose her original glory. Let's look at the end of Perl. People will leave somewhere else.

Python 3 is killing Python

Http://www.oschina.net/translate/python-3-is-killing-python.

Related Article

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.