If You Love Python, Please Use Python 3

         I was just reading yet another question on Zhihu about whether to use Python 2 or Python 3, and an idea flashed through my mind. I suddenly realized I was on the verge of harming such a brilliant language.

Since summer break, I’ve been learning Python. I first spent over ten days working through Learn Python the Hard Way, and then finished the Python section on Codecademy the following week. In short, I had gotten my feet wet. I鈥檝e also dabbled superficially in a few other languages before, like Visual Basic, Java, C, JavaScript, and Objective-C which I’ve been grinding through lately. But I have to say, Python is the most concise, elegant, and fun language I’ve ever encountered (getting familiar with Python and then trying Objective-C is truly a form of torture).

I LOVE Python!

However, due to adopting some previous advice, and the fact that Mac OS X ships with 2.7, I firmly believed that “Python 2 is already great, why bother migrating to 3?”

I believe many people share this mindset, because on many forums, when version choice questions arise, nearly half the people recommend version 2. Watch out! This kind of thinking will only harm Python and, ultimately, harm us.

Take Windows as an example. When Windows 7 was released (I won’t even mention Vista), many people clung stubbornly to XP. When you asked them why, they would say with a straight face, “The new system lags,” or “Many applications are incompatible,” or “It changed so much, it’s so unfamiliar,” or even “XP is already a perfect system; Microsoft only releases new ones to rip us off.” -_-# So, season after season, we bid farewell to Win 7 and welcomed Win 8, yet these people’s mindsets haven’t changed (I believe this situation is more common among Chinese users). If too many people act like this and it continues, the final outcome will just be Microsoft’s situation worsening until people eventually have no choice and surrender to Linux (hey, why does that give me a subtle thrill?).

When I mentally replaced Win XP with Python 2 and Win 7 with Python 3 or even Python 4, I couldn’t help but shudder. I had nearly conspired with others to slowly kill Python! Imagine, years from now, languages like Ruby and Go have gained many new features. Although the latest Python is also excellent, because some people refuse to change, stubbornly clinging to an old version, throwing out laughable excuses, Python ultimately declines due to user habits. All the effort of Guido and the entire Python community gets disregarded for the sake of those habits.

Let’s look at these laughable excuses (for detailed explanations, check out Xu Niangquan’s answer on Zhihu; I’ll briefly summarize them here):

What? There are too few libraries supporting Python 3? Wake up, it’s been 6 years, and the latest version is 3.4.1. Libraries that don’t support Python 3 by now are mostly unmaintained legacy items.

What? The new version has poor backward compatibility? Don’t worry, future versions will only become more incompatible, unless you plan to stick with Python 2 forever. Besides, is it really that hard to adapt a little for new features?

Finally, to those still clinging to the old version, aren’t all your complaints and criticisms just a defense of your own inertia?

It suddenly struck me that Apple handles this aspect incredibly well (a perk of a closed ecosystem). Whether it’s Mac OS or iOS, each new system release gets a vast majority of users to upgrade within a very short time. Just imagine, Swift, which squeezed into the TIOBE top 20 just over a month after release, even needed a whole year? Just go straight for the jugular: announce that after 6 months, App Store will no longer accept apps written in Objective-C…

Leave a Comment

Your email address will not be published.